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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.