Jump to content

[SOLVED] Hiding static content if column is null (should be simple)


duduwudu

Recommended Posts

Hello, I'm sure this is very simple, but as a bit of a beginner I would appreciate any help.

 

I have a page that is pulling information from a database of local businesses. One of the columns is a URL and on the page I have a link 'Visit website' and the url from the database is the link. However, not all the entries in my database have a website and are null. So this is creating the problem that some of my listing have a link that says visit website, that go nowhere. This is the code i am using:

<a href="<?php echo $row_Businesses['website']; ?>" target="_blank">Visit Website</a>

 

What I would like is, if the 'website' column is null then the visit website link doesn't appear but if there is an entry for the 'website' column then there is a link saying visit website that has the 'website' column entry as the link (like above).

 

Any help that'll help me understand or get this done would make me a very happy boy :)

Cheers

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.