LaTicca Peeples wrote:
> $date = date("D, d M yyyy, h:ia T");
>
> and my connection includes:
> $sqlquery = "INSERT INTO $table VALUES('$id','$name','$date')";
MySQL expects datetimes in the format 'yyyy-mm-dd hh:mm:ss' in INSERT statements. This is not what you provide.
> my objective is simply to add a date field with the current date and time.
> i want mysql to insert the date for me in the format resulting in this type of output:
> Fri, 19 Aug 2005, 10:23am CST.
See above. If you want to *output* dates in some format, use the DATE_FORMAT() function.
See
http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html for formatting options.
(I don't think it does time zones though).
--
felix
Please use
BBCode to format your messages in this forum.