I have come across a slight problem whilst producing a page, well not so much a problem, more of an annoyance.
I have the following code:
Code: Select all
$tabSql = mysql_query("SELECT * FROM videoTabs WHERE tabCat = $catID", $link);
while($tabJava = mysql_fetch_array($tabSql)){
echo "option[". $tabCount ."] = \"" . $tabJava[tabDivID] . "\""."\n";
$tabCount++;
}Code: Select all
$tabSql = mysql_query("SELECT * FROM videoTabs WHERE tabCat = $catID", $link);
// generate tab buttons
while($tabBut = mysql_fetch_array($tabSql)){
echo '<li><a href="#videoTabs" onclick="toggleTab(\''. $tabBut[tabDivID] .'\')"><span>'. strtoupper($tabBut[tabName]) .'</span></a></li>'."\n";
}If I get rid of the second $tabSql then the second whilst loop will not work.
Is there anyway to re-use that array that has been built using the original $tabSql query?