
Unix timestamp, formatted date and MySQL
Hey, I have my MySQL database with a field called "validTo" which is of
fieldtype datetime.
Im displaying dates in this format: "28/11/2002 14:45:51"
Im using the function dateToUnix() to make this date format into a
timestamp. Then i reformat with "date(Y-m-d H:i:s)" to make it a format
understandable for MySQL.
When I try to update MySQL with the format created ("2002-11-28 14:45:51") I
get this msg: You have an error in your SQL syntax near '14:45:51,
priority='3' WHERE newsId=3' at line 1
I cannot find why this is illegal syntax, would anyone pls enlighten me?
I have another similar field where I only do a date(Y-m-d H:i:s) and it
works fine... also a datetime type column
These are the var values:
validstamp= 1038491151
validto= 28/11/2002 14:45:51
datestamp= 2002-11-07 14:53 // = time()
fdate= 2002-11-28 14:45:51
Here is the code, stripped down to a minimum for you, let me know if you
want the full version; http://www.*-*-*.com/
thanks in advance, Chris