I have a minor problem right now. I want to pull multiple rows (each identifed by having an identical id column) from a table in my mysql database and display them with a for loop.
This is the code:
$check = mysql_query("SELECT FROM response WHERE topicid='$topicid'");
$loopmax = mysql_num_rows($check);
for ($counter=1; $counter <= $loopmax; $counter++)
{
$info = mysql_query("SELECT FROM response WHERE topicid = '$topicid'");
$new = mysql_fetch_row($info);
echo "<TABLE width=600 height=150 border=1 align=0> <TR><TD> $new[1]<P>$new[0]</TD>";
echo "<TD>'$new[1]'</TD> </TR></TABLE><P>";
}
The result is that I only get the first result that matches the query and none of the rest.
How can I code this correctly?