John, thanks, now I feel stupid, it's always the silly little things that get you. You were right, when I added the date to the existing insert I forgot to put the ending parentheses back in. Thanks for the help.


At 11:26 AM 7/28/2003, CPT John W. Holmes wrote:
From: "Andrew D. Luebke" <[EMAIL PROTECTED]>
>          $date = date("Y-m-d H:i:s");
>          $result = mysql_query("INSERT INTO Boats (Make, Model, Serial,
> Stock, Extension, Cust_Name, Store, Date) VALUES
>                  ('$make', '$model', '$serial', '$stock', '$extension',
> '$name', '$store', '$date'")
>                  or die("Invalid query: " . mysql_error() .
> The problem is with the Date column.  It is of type DATETIME.  I get an
> error on the second line of the insert statement.  I assume I'm not
> formatting the date-time variable correctly but I've tried everything I
> think of, so any help is very much appreciated.  Thanks.

Like someone else said, using Date as a column name probably isn't very
smart. Your problem is caused by not having a closing parenthesis in your
query, though.


---John Holmes...

-- PHP Database Mailing List ( To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to