Re: Can you use null?
| From: | Justin French | Date: | Thu, 28 Mar 2002 04:57:29 +0000 |
| Subject: | Re: Can you use null? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90471@lists.php.net to get a copy of this message | ||
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 (cepayne@magidesign.com) 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 |
> | cepayne@magidesign.com |
> ----------------------------
>
> 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
>
>