MDanz Posted August 28, 2009 Share Posted August 28, 2009 if($row_data != FALSE) { $image = $row_data['imagelocation']; $stackname = $row_data['name']; echo "<td><a href='http://www.gsdgsg.com/search.php?search=$stackname' style='text-decoration: none';><table border='0' celpadding='0' cellspacing='0'> <tr> <td width='100px' height='101px' [b]background='$image'[/b] VALIGN='middle'> <font size=3 font face=Arial font color=white><center><b><font style='background-color: black'>$stackname</font></b></center></font></td> </td> </tr> </table></a></td>"; } the part bolded... i want IF a value is in the row(imagelocation) of the database use the above code. If a value isn't in the row, then use the code below. How do i do this? if($row_data != FALSE) { $image = $row_data['imagelocation']; $stackname = $row_data['name']; echo "<td><a href='http://www.gsdgsg.com/search.php?search=$stackname' style='text-decoration: none';><table border='0' celpadding='0' cellspacing='0'> <tr> <td width='100px' height='101px' [b]background='[b]Stacks/template.jpg[/b]'[/b] VALIGN='middle'> <font size=3 font face=Arial font color=white><center><b><font style='background-color: black'>$stackname</font></b></center></font></td> </td> </tr> </table></a></td>"; } Link to comment https://forums.phpfreaks.com/topic/172289-solved-help-with-if-statement/ Share on other sites More sharing options...
ReKoNiZe Posted August 28, 2009 Share Posted August 28, 2009 Using empty() should work: if(!empty($image)) <td width='100px' height='101px' [b]background='$image'[/b] VALIGN='middle'> else <td width='100px' height='101px' [b]background='[b]Stacks/template.jpg[/b]'[/b] VALIGN='middle'> Link to comment https://forums.phpfreaks.com/topic/172289-solved-help-with-if-statement/#findComment-908391 Share on other sites More sharing options...
MDanz Posted August 28, 2009 Author Share Posted August 28, 2009 thx .. Link to comment https://forums.phpfreaks.com/topic/172289-solved-help-with-if-statement/#findComment-908398 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.