2 Dec 2006 at 22:12 #1 Wimnat Wimnat Associate Joined 19 Jun 2006 Posts 162 Location Swansea, Wales When i submit a form to my mySql db with php i want to datestamp the entry in the format 2006-12-02. Is it best to use the php function to get the date first or can you use mysql to add the date on entry?
When i submit a form to my mySql db with php i want to datestamp the entry in the format 2006-12-02. Is it best to use the php function to get the date first or can you use mysql to add the date on entry?
3 Dec 2006 at 09:24 #2 toosepin toosepin Associate Joined 9 Jun 2006 Posts 954 Location Manchester Give this a read.
3 Dec 2006 at 15:50 #3 Wimnat Wimnat Associate OP Joined 19 Jun 2006 Posts 162 Location Swansea, Wales I tried this... INSERT INTO mbs_table dateadded VALUES (CURDATE( ) ) but got an sql error. Any ideas?
I tried this... INSERT INTO mbs_table dateadded VALUES (CURDATE( ) ) but got an sql error. Any ideas?
3 Dec 2006 at 17:24 #4 meghatronic meghatronic Soldato Joined 24 Nov 2002 Posts 16,378 Location 38.744281°N 104.846806°W Have you tried "INSERT INTO mbs_table dateadded VALUES (CURDATE())?
3 Dec 2006 at 18:20 #5 LazyManc LazyManc Associate Joined 21 May 2003 Posts 1,365 try NOW() instead of CURDATE()
4 Dec 2006 at 19:04 #6 Wimnat Wimnat Associate OP Joined 19 Jun 2006 Posts 162 Location Swansea, Wales Cracked it... had to use SET rather than INSERT
4 Dec 2006 at 19:37 #7 robmiller robmiller Soldato Joined 26 Dec 2003 Posts 16,522 Location London Wimnat said: Cracked it... had to use SET rather than INSERT Click to expand... That doesn't sound right at all. :/
Wimnat said: Cracked it... had to use SET rather than INSERT Click to expand... That doesn't sound right at all. :/