Jump to content

[SOLVED] A simple if null question (i hope)


duduwudu

Recommended Posts

Hello,

I'm sure this is very simple, but I'm just getting started with php and mysql and was wandering if someone could help me with a snipped of code.

I have a page that displays information from my database. One of the items it displays is an image. like this:

 

<img src="<?php echo $row_Businesses['logo_url']; ?>" alt="<?php echo $row_Businesses['name']; ?>" width="100" height="100" border="1" />

 

Now, not all of the rows in my database have an entry for 'logo_url' and are null. I would like it so that if 'logo_url' is null it will instead show an alternative image called nologo.gif

 

I imagine it would be along the lines of if 'logo_url' = null show nologo.gif else show <?php echo $row_Businesses['logo_url']; ?>.

 

Any help would make me a very happy boy,

Cheers :D

Link to comment
https://forums.phpfreaks.com/topic/63877-solved-a-simple-if-null-question-i-hope/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.