I have this query:
$sql = mysql_query("SELECT * FROM $table WHERE serialnumber= " . $serialnumber . " ORDER BY serialnumber");
now its ok for SOME of the rows to be null, but not all. When asking this query, if a serial number is not in the database it continues with the operation 'cause the query will always return true.
if i use
if(!mysql_num_rows($sql))
then it filters out almost all the rows returned because there is inevitably a couple blank rows in the table which is fine.
I tried playing with the mysql_num_rows but to be honest, I have no clue how to use it correcty other than the previous statement. > and < don't work (at least the way I tried it).
How can I get this to die if the serial number doesn't exist?
edit: additionally I'm outputting everything via
echo "<p><p><table>";
while ($row = mysql_fetch_row($sql)) {(html stuff)}
if that helps in any way
Thanx mucho
Nico