RE: [PHP] Can you use null?

2002-03-28 Thread Rick Emery

you test for a NULL value with PHP's isset() function.

if( ! isset($image_name) )
{
...   display no image   ...
}

-Original Message-
From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 9:32 PM
To: PHP General
Subject: [PHP] Can you use null?


I am wanting to know if I can use null to call up an image? I am writing a
page that talks to calls to a database for cars. There a field where calls
on photo names, but if someone doesn't have a photo. Mysql puts null, I want
to be able to use that null to call an image.


 
 | Chuck Payne  |
 | Magi Design and Support  |
 | www.magidesign.com   |
 | [EMAIL PROTECTED]   |
 

BeOS, Macintosh 68K, Classic, and OS X, Linux Support.
Web Design you can afford.

Never be bullied into silence. Never allow yourself to be made a victim.
Accept no one's definition of your life; define yourself.- Harvey Fierstein



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Can you use null?

2002-03-27 Thread Chuck \PUP\ Payne

I am wanting to know if I can use null to call up an image? I am writing a
page that talks to calls to a database for cars. There a field where calls
on photo names, but if someone doesn't have a photo. Mysql puts null, I want
to be able to use that null to call an image.


 
 | Chuck Payne  |
 | Magi Design and Support  |
 | www.magidesign.com   |
 | [EMAIL PROTECTED]   |
 

BeOS, Macintosh 68K, Classic, and OS X, Linux Support.
Web Design you can afford.

Never be bullied into silence. Never allow yourself to be made a victim.
Accept no one's definition of your life; define yourself.- Harvey Fierstein



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Can you use null?

2002-03-27 Thread Justin French

Hi,

Just do a test on the result of the image URL field, and if the field value
is null (or ), change the field to a default image URL...

?

if($myrow[image_url] ==  or $myrow[image_url] == null)
{
$myrow[image_url] = images/default_image.gif;
}
echo IMG SRC=\.$myrow[image_url].\;

?


Justin French

Creative Director
http://Indent.com.au




on 28/03/02 2:32 PM, Chuck PUP Payne ([EMAIL PROTECTED]) wrote:

 I am wanting to know if I can use null to call up an image? I am writing a
 page that talks to calls to a database for cars. There a field where calls
 on photo names, but if someone doesn't have a photo. Mysql puts null, I want
 to be able to use that null to call an image.
 
 
 
 | Chuck Payne  |
 | Magi Design and Support  |
 | www.magidesign.com   |
 | [EMAIL PROTECTED]   |
 
 
 BeOS, Macintosh 68K, Classic, and OS X, Linux Support.
 Web Design you can afford.
 
 Never be bullied into silence. Never allow yourself to be made a victim.
 Accept no one's definition of your life; define yourself.- Harvey Fierstein
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php