limitphp Posted November 11, 2008 Share Posted November 11, 2008 I'm using this query: mysql_query("INSERT INTO vote (artistID, songID, date, userID) VALUES ('$artistID', '$songID', 'NOW()', '$userID')"); In the table when it inserts it, the date is not working. The date type is datetime. How do I get it to show as ex) 2008-11-04 08:10:25. Thanks Link to comment https://forums.phpfreaks.com/topic/132322-solved-now-function/ Share on other sites More sharing options...
rhodesa Posted November 11, 2008 Share Posted November 11, 2008 remove the single quotes around NOW(): mysql_query("INSERT INTO vote (artistID, songID, date, userID) VALUES ('$artistID', '$songID', NOW(), '$userID')"); Link to comment https://forums.phpfreaks.com/topic/132322-solved-now-function/#findComment-687950 Share on other sites More sharing options...
limitphp Posted November 11, 2008 Author Share Posted November 11, 2008 remove the single quotes around NOW(): mysql_query("INSERT INTO vote (artistID, songID, date, userID) VALUES ('$artistID', '$songID', NOW(), '$userID')"); Thank you.... Link to comment https://forums.phpfreaks.com/topic/132322-solved-now-function/#findComment-687952 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.