Current location: Hot Scripts Forums » Programming Languages » PHP » date time fields are they really NULL?


date time fields are they really NULL?

Reply
  #1 (permalink)  
Old 03-29-04, 11:54 AM
sky4est sky4est is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
date time fields are they really NULL?

I'm checking to see if the values for a date and time field from a MySQL database are NULL. Sounds easy, but I can't get it to work. Should I be writing my conditionals for NULL or 00/00/0000 or 00:00:00 respectively? Here's what I'm currently doing:

if ($event_time_2_1 == NULL)
{
echo ("not null");
}
else
{
echo ("null");
}
Reply With Quote
  #2 (permalink)  
Old 03-29-04, 12:59 PM
Bonzo's Avatar
Bonzo Bonzo is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 340
Thanks: 0
Thanked 0 Times in 0 Posts
I am not sure but aren't you checking that it is equal to the string "NULL" ?

Try putting "" instead ?

Anthony
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
Newbie MySQL fccolon PHP 2 03-16-04 10:54 AM
MySQL Query problem Wraith PHP 5 03-06-04 05:16 PM
help regarding insertion of date time wajeeh_r ASP 1 03-04-04 04:05 PM
picking random entries with a filter... Double selection problem dsumpter PHP 7 11-16-03 07:19 PM
Help with making a installer config script dazz Job Offers & Assistance 3 09-29-03 02:51 AM


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