Sorry, I'm an experienced programmer, but a novice when it comes to PHP. I think my question is very simple though. Lets say I have a query like this:
$result = mysql_query( "SELECT * FROM myTable );
Can I use that more than once on the same page? I tried outputting it into two tables, one right after the other, but only the first table is displayed.
The second table doesn't display. Do I have to execute the query over and over again for every time I want to output the results?
Kevin
slanek@ssd.fsi.com
"Life is what happens to you while you're busy making other plans."
- John Lennon
$result = mysql_query( "SELECT * FROM myTable );
Can I use that more than once on the same page? I tried outputting it into two tables, one right after the other, but only the first table is displayed.
Code:
echo "There are $catCount categories"
."<BR><HR><BR>"
."<TABLE ID=\"catTbl\" STYLE=\"border:1px black solid\" CELLSPACING=\"0\" CELLPADDING=\"5\">";
while ( $cat = mysql_fetch_object( $result ) )
{
echo "<TR>"
."<TD>".$cat->category."</TD>"
."</TR>";
}
echo "</TABLE>";
echo "<BR><HR><BR>"
."<TABLE ID=\"catTbl\" STYLE=\"border:1px black solid\" CELLSPACING=\"0\" CELLPADDING=\"5\">";
while ( $cat2 = mysql_fetch_object( $result ) )
{
echo "<TR>"
."<TD>".$cat2->category."</TD>"
."</TR>";
}
echo "</TABLE>";
The second table doesn't display. Do I have to execute the query over and over again for every time I want to output the results?
Kevin
slanek@ssd.fsi.com
"Life is what happens to you while you're busy making other plans."
- John Lennon