|
Posted by Rik on 10/14/73 11:51
Techie123 wrote:
> To get to the point, I'm currently facing a problem with the
> smalldatetime datatype. I can't INSERT a NULL value. The best I can
> get so far is having 01/01/1900 00:00:00 AM show up.
>
> The field is already set to accept NULL values and I can insert them
> manually by creating a new line with nothing in the smalldatetime
> fields or using ctrl+0, but when I try to do the following I get an
> error:
> <?php
> $qryStr = "INSERT INTO OPSCenterISS (EventTypeID, EventStatus,
> EventTitle, Location, AffectedUsers, EventDescription, StartDateTime,
> EndDateTime, Contact, Organization, SubmitDateTime )
> VALUES ( '$typeidinput', '$statusinput', '$titleinput', '$locinput',
> '$affectedinput', '$descinput', '$startdatetime', 'NULL',
> '$contactinput', '$orginput', '$submitdatetime' )"
> or die ("Error in ODBC Write");
> odbc_prepare ($sqlconnect, $qryStr);
> odbc_exec($sqlconnect, $qryStr);
What if you try to write NULL instead of 'NULL'.
Now you're trying to add the string 'NULL' to the database instead of a
NULL, which the database won't like if it's supposed to be a date format.
Grtz,
--
Rik Wasmus
[Back to original message]
|