Hi everyone. I am trying to make a table that when people edit something from it, it will show the date it was edited.
This is my code:
Code: ( php )
$date = date("m/d/Y");
mssql_query("INSERT INTO news2 (title, dtime, text1, text2) VALUES ('$title', '$date', '$text1', '$text2')");
The thing is that when I check the table, the time is messed up. It shows 4/11/1900 instead of 01/21/2008.
I tried using now() instead of '$date' but I get the following error:
Warning: mssql_query() [function.mssql-query]: message: Syntax error converting datetime from character string. (severity 16) in C:\xampp\htdocs\news2.php on line 22
Warning: mssql_query() [function.mssql-query]: Query failed in C:\xampp\htdocs\news2.php on line 22
Also, is there a way I can add the time next to the date into the database?
Btw, is there a way I could insert the date into the database like this: 12:50am 31/12/2008
Thank you
~ SalokinX