PDA

View Full Version : !value still showing


subnet_rx
12-02-2004, 02:47 AM
<?php if (isset($row['Pic0'])) {echo '<img src="images/listings/'.$row['ListingID'].'/thumbs/'.$row['Pic0'].'" />'; }?>


Eventhough the database doesn't have a value for 'Pic0', this is still printing. At the point where it prints $row['Pic0'], nothing prints. The var_dump shows:


["Pic0"]=> string(0) "" [34]=> string(0) ""

schotte
12-02-2004, 04:29 PM
Hey,

isset only checks, whether a variable is set or not. In your case $row is set. So I think the function you are looking for is empty() (http://uk.php.net/manual/en/function.empty.php) instead of isset().

Frank

subnet_rx
12-02-2004, 04:50 PM
that'll do it, thanks for your help.