yusufali Posted August 13, 2012 Share Posted August 13, 2012 I have a string eg: 2011-10-02 00:00:00 that needs to be stored in a mysql row were the format is "datetime" if i used mysql_query("UPDATE _match SET date = " . $date . " WHERE id_match = " . $id); and $date is the string given above, it does not work i've tried using timestamp and what not but still, does not work any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/266996-how-to-store-datetime-in-mysql/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 13, 2012 Share Posted August 13, 2012 See this post - http://forums.phpfreaks.com/index.php?topic=363620.msg1721259#msg1721259 Quote Link to comment https://forums.phpfreaks.com/topic/266996-how-to-store-datetime-in-mysql/#findComment-1368892 Share on other sites More sharing options...
yusufali Posted August 13, 2012 Author Share Posted August 13, 2012 okay, so i tried mysql_query("UPDATE _match SET match_date = " . '$date' . " WHERE id_match = " . $id); so i put the single quotes around, as said in the thread quoted, but it still does not work Quote Link to comment https://forums.phpfreaks.com/topic/266996-how-to-store-datetime-in-mysql/#findComment-1368893 Share on other sites More sharing options...
scootstah Posted August 13, 2012 Share Posted August 13, 2012 Close. match_date = '" . $date . "' Quote Link to comment https://forums.phpfreaks.com/topic/266996-how-to-store-datetime-in-mysql/#findComment-1368894 Share on other sites More sharing options...
yusufali Posted August 13, 2012 Author Share Posted August 13, 2012 ugh, wow... thanx problem solved Quote Link to comment https://forums.phpfreaks.com/topic/266996-how-to-store-datetime-in-mysql/#findComment-1368898 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.