Jump to content

Count function won't return 0 when counting arrays from the DB


mschrank99

Recommended Posts

If there's nothing to be found, then $row will be set to false.  The value false consists of one item, so counting it will always give you one.

Instead, use

[code]if ($row === false) print "Finished fetching data from database\n";[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.