[thelist] checking for empty vars in PHP

Tom Dell'Aringa pixelmech at yahoo.com
Fri Jan 3 10:59:01 CST 2003

I have this result set I am looping through. If there is nothing in
the set, I want to print out an message. Here is the code:
while($row = mysql_fetch_array($result))
    $prodname = $row["prodName"];
	$prodprice = $row["prodPrice"];
	$pid = $row["pid"];
	$photo = $row["photo"];

		print "registry is empty.";
//display stuff

I am not getting the print statement at all with this, even though
$prodname is blank or empty. I have tried

if($prodname == "") and if(!$prodname) but these didn't work for me.
Am I testing the wrong thing? $prodname certainly is = "" so I am
totally confused!


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