MySQL (I assume that's the database you're inserting into) requires dates to
be sent in YYYY-MM-DD format. You appear to be sending a unix timestamp.


date("Y-m-d",time()) // Sends a MySQL style date.

or even:

$SQL = "INSERT INTO orders (Customer_Id, Order_Date) VALUES($CustID,NOW())";
// uses MySQL's builtin date function to store the current date.



----- Original Message -----
From: "Alia Mikati" <[EMAIL PROTECTED]>
Sent: Friday, April 19, 2002 10:28 AM
Subject: [PHP] Date function

> Hello
> I have the following SQL and I wanna insert the current date in one of
> the table fields but it's not working. Can u tell me whats the problem?
> (I'm using mysql and php)
> Thx a lot
> $SQL = "INSERT INTO orders (Customer_Id, Order_Date)".
>                          "VALUES($CustID,date())";
> --
> PHP General Mailing List (
> To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to