Current location: Hot Scripts Forums » Programming Languages » PHP » Help! Image Display "IF"


Help! Image Display "IF"

Reply
  #1 (permalink)  
Old 04-11-05, 10:59 PM
dayzeday dayzeday is offline
Newbie Coder
 
Join Date: Sep 2003
Location: Joplin, MO
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Help! Image Display "IF"

I am trying to get an image field to NOT display if a image is NOT present. I managed to get this to work displaying the path but I can not get it to work with the image. It gives me a string error. I have tried it a few ways and same problem. Please HELP!

Here is the path one I used:
PHP Code:

 <?php if ($row_Recordset1['photo'] == null) echo ""?>

Here is the image one I used:
PHP Code:

 <?php if ($row_Recordset1['photo'] == not null) echo "<img src='../IMAGES/BK-1.gif'/>"?>


Last edited by dayzeday; 04-11-05 at 11:00 PM. Reason: missed second code - for editing
Reply With Quote
  #2 (permalink)  
Old 04-12-05, 03:52 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
you can't use not in php
you will have to use != instead..
PHP Code:

if ($row_Recordset1['photo'] !== null)

   echo 
"<img src='../IMAGES/BK-1.gif'/>"
but this will display this BK-1.gif if this $row_Recordset1['photo'] does exist!
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to display the image from the database??? jaishalg PHP 8 01-26-05 05:47 PM
image display coldclimber ASP 0 10-26-04 09:22 AM
Image display based on URL rjwebgraphix PHP 5 09-09-04 08:02 AM
PHP with a 'JavaScript-ish' Image Display Cypris PHP 1 07-03-04 03:05 AM
Display a dynamic image Bonzo PHP 1 04-28-04 04:05 AM


All times are GMT -5. The time now is 06:39 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.