violinrocker Posted June 1, 2010 Share Posted June 1, 2010 how will i make ummm like.... I have an image field and a default image field.... if the image field is empty, get the default image field, and if both the image field and default image field is empty, echo no_image.gif.... but if image field has something in it, echo that thing and dont get the default image field and no_image.gif Link to comment https://forums.phpfreaks.com/topic/203503-if-and-else/ Share on other sites More sharing options...
Alex Posted June 1, 2010 Share Posted June 1, 2010 I'm assuming you're fetching from a database. ... $row = mysql_fetch_assoc($result); if(!empty($row['image_field'])){ // ... } else if(!empty($row['default_image'])){ // ... } else { // ... } Link to comment https://forums.phpfreaks.com/topic/203503-if-and-else/#findComment-1066079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.