In mysql, how can I update timestamp type?
Hi I have a table which have timestamp value, when I write that in php
mysql_query("UPDATE 开发者_如何学编程table SET date=$newdate WHERE name=ibrahim");
it does not work. $newdate is a string value that I read from same table before. How can I change date column? thanks for help...
You need to put string values (including date literals) in quotes for MySQL.
mysql_query("UPDATE table SET date='$newdate' WHERE name='ibrahim'")
mysql_query("UPDATE table SET date='{$newdate}' WHERE name='ibrahim'"); //quote your strings
精彩评论