RE: [PHP] while loop with if statement - here's the code

2001-08-20 Thread sgibbs
Thanks Steve! :) Here's the code: ? $results = mysql_db_query($db, select * from $table where $query order by update_datetime desc limit $offset, 10); while($one = mysql_fetch_array($results)){ $id=$one[id]; $title=$one[title]; $description=$one[description];

Re: [PHP] while loop with if statement - here's the code

2001-08-20 Thread Steve Brett
try using mysql_num_rows() to get the number of rows returned by the query. you need to supply it with the identifier for the query not the sql you sent to the query. not exactly sure what you're trying to do though ... Steve [EMAIL PROTECTED] wrote in message

Re: [PHP] while loop with if statement - here's the code

2001-08-20 Thread Steve Brett
okay - read all the code now. this might be a better way: ?php $results = mysql_db_query($db, select * from $table where $query order by update_datetime desc limit $offset, 10); $one = mysql_fetch_array($results); $numrows=mysql_num_rows($one);// get the number of results if ($numrows0)

RE: [PHP] while loop with if statement - here's the code

2001-08-20 Thread Alnisa Allgood
At 11:02 AM -0400 8/20/01, [EMAIL PROTECTED] wrote: ? $results = mysql_db_query($db, select * from $table where $query order by update_datetime desc limit $offset, 10); while($one = mysql_fetch_array($results)){ $id=$one[id]; $title=$one[title];