I am trying to get an output from my database to look like this:
[CODE]<script type=”text/javascript”>
initializetabcontent(“maintab”, “6maintab”, “5maintab”, “4maintab”, “3maintab”, “2maintab”)
</script>
Here is my code:
[code=php] //Javascript for Tab Content//
echo “<script type=’text/javascript’>”;
//Initialize every single tab contnet//
echo “initializetabcontent(‘”;
while($onehome = mysql_fetch_array($sql))
{
$onehome[‘PortfolioID’].”maintab’,”;
}
echo “)”;
echo “</script>”;
//End of Javascript//
Here is what I want it to look like:
[CODE]<script type=”text/javascript”>
initializetabcontent(“maintab”, “6maintab”, “5maintab”, “4maintab”, “3maintab”, “2maintab”)
</script>
I can’t get it working for some reason and I don’t know why. Anyone have any suggestions.
p.s. My while statement seems accurate and all my coding before and after the while statement is correct, I tested it with other results. However, when I introduce Javascript in a scenario like the one above, I get the error. Urgent help!