Cyberspace Posted April 11, 2008 Share Posted April 11, 2008 Im trying to add the current date in a mysql database, but im not sure if im on the right track: Im using the following sql insert statement: mysql_query("INSERT INTO walker (MemberRef, WalkNo, DateJoined) VALUES ('$MemberRef', '$WalkNo', NOW()"); Can i use date(Now) to insert the current date? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted April 11, 2008 Share Posted April 11, 2008 mysql_query("INSERT INTO walker (MemberRef, WalkNo, DateJoined) VALUES ('$MemberRef', '$WalkNo',NOW())"); Assuming DateJoined is one of the Date datatypes Quote Link to comment Share on other sites More sharing options...
discomatt Posted April 11, 2008 Share Posted April 11, 2008 If DateJoined is a datetime type column, the query you posted should work fine Quote Link to comment Share on other sites More sharing options...
benphp Posted April 11, 2008 Share Posted April 11, 2008 nevermind Quote Link to comment Share on other sites More sharing options...
Cyberspace Posted April 11, 2008 Author Share Posted April 11, 2008 mysql_query("INSERT INTO walker (MemberRef, WalkNo, DateJoined) VALUES ('$MemberRef', '$WalkNo',NOW())"); Assuming DateJoined is one of the Date datatypes Thanks for that Quote Link to comment 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.