let me be more specific... if a field value is null how do I test for it in the result set, or the array?
here's a real live example... I'm working with prepaid phone cards, and if a card has not expired yet then the field zombie_date will be null. so - when I do the mysql_fetch_assoc ($sql) what value will the field contain if the resulting recordset was a null? instead of leaving that table space blank I would like to populate it with "Not Expired" or something like that. (I have a lot of scenario's where I would like to use that). "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Justin French wrote: > > >on 30/09/02 2:44 PM, Jeff Bluemel ([EMAIL PROTECTED]) wrote: > > > > > >>how to I test for a null value? > >> > >> > >empty()? isset()? if($var == "")? if($var == "NULL")?? have a look in > >the php manual for string functions, and comparison operators > > > > I think he maybe meant testing for null values in SQL. > > If this is true, there is the null keyword: "is null" and "is not null". > > select * from table_name where column_name is not null > > This selects all rows from a table where the data in column column_name > is not null. Be careful with this, as it actually tests for null and not > an empty string, for example. If you want to test whether a value is > null once you have assigned it to a PHP variable, you can use one of > Justin's suggestions. > > In addition, PHP has null as well. > > Happy hacking. > > Chris > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php