[thelist] checking for empty result rows in PHP

Tom Dell'Aringa pixelmech at yahoo.com
Wed Dec 11 15:10:01 CST 2002

What is the best way to check for a result set that is empty? I have
the following:

while($row = mysql_fetch_array($result))
    $registrar = $row["registrar"];

	if($registrar == "")
		print "registry is empty.";
	print "r: $registrar";

I tried using empty() and tried checking to see if $row was empty()
and those didn't seem to work.


var me = tom.pixelmech.webDeveloper();

[Making A Commercial Case for Adopting Web Standards]

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

More information about the thelist mailing list