Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

V1.11 --> Problem with INSERT

Quote Reply
V1.11 --> Problem with INSERT
I am having a problem inserting a date value into a column of a new row I am adding to a table called SiteDay. The LinkID is added just fine. I have set the DateAdded field as a DATE field (I also tried setting it to TIMESTAMP, but the format is not what I want).

Now, I have read the documentation regarding Date Types at http://www.mysql.com. It seems that the default value of 0000-00-00 cannot be overridden. But this doesn't make sense because date values are added just fine in other tables using the DATE field type. I've also looked at other Links SQL scripts as references to see how the date field is added.

Here is what I have tried so far:

1) Added the following codes before the INSERT codes:

Code:

$today = $SITEDB->get_date;
$in->param ( -name => 'DateAdded', -value => $today );


2) I have also tried using the following INSERT codes:

Code:

$sth = $SITEDB->prepare ("SELECT 1 FROM SiteDay WHERE LinkID = $id");
$SITEDB->do ("INSERT INTO SiteDay (LinkID,DateAdded) VALUES ($id,$today)");


AND

Code:

$sth = $SITEDB->prepare ("SELECT 1 FROM SiteDay WHERE LinkID = $id");
$SITEDB->do ("INSERT INTO SiteDay (LinkID) VALUES ($id)");


I am at a lost...I do not know why the date insertion is not working.

Any suggestions are welcome.

Thanks in advance.

Regards,

Eliot Lee

Subject Author Views Date
Thread V1.11 --> Problem with INSERT Stealth 3479 Oct 3, 2000, 7:21 PM
Thread Re: V1.11 --> Problem with INSERT
Stealth 3400 Oct 3, 2000, 7:28 PM
Thread Post deleted by Clueless
Clueless 3394 Oct 3, 2000, 8:10 PM
Thread Re: V1.11 --> Problem with INSERT
Stealth 3392 Oct 3, 2000, 8:18 PM
Thread Re: V1.11 --> Problem with INSERT
pugdog 3372 Oct 3, 2000, 9:26 PM
Post Re: V1.11 --> Problem with INSERT
Stealth 3371 Oct 3, 2000, 9:33 PM