Originally posted by ollmorris
I have 10 variables $option1 - $option10. I have another variable,
$total = "<img src=\"$myrow[option1]>";
However I want the $myrow[option1] to go up +1 each time it is ECHOED, option2, option3 etc. I know I will be using the WHILE thing but what else will I need?.
just create a new variable before you loop.. then increment it at the end of your loop.
<?
$i=0;
while(mysql_fetch_row($result) as $myrow)
{
$total = "<img src=\"$myrow[$i]>";
$i++;
}
?>
eh, sorry, my syntax might not be exact, but you should be able to use that incrementing method.