Forums
This topic is locked
How to insert the date using php_mysql into MySQL?
Replies
Replied 11 Feb 2003 16:12:55
11 Feb 2003 16:12:55 Brent Colflesh replied:
Replied 12 Feb 2003 10:22:35
12 Feb 2003 10:22:35 Iain Stewart replied:
Hi,
the way i do it is, use a timestamp in the table that way when the db is updated the time date is put in for you, then to diplay it on your page use
Date_Fornat() in your sql statement.
You will need to go to advanced in you querry. and use something like
SELECT colA,colB,colC,DATE_FORMAT(colDate,'%d-%m-%Y %T')
From.....
there are various %d-%m-%y you can use to display the date, weither you want month in name or number etc look at
www.mysql.com/doc/en/Date_and_time_functions.html
hope this helps
Iain
head hurts, 'mental note to self, stop banging head !'
the way i do it is, use a timestamp in the table that way when the db is updated the time date is put in for you, then to diplay it on your page use
Date_Fornat() in your sql statement.
You will need to go to advanced in you querry. and use something like
SELECT colA,colB,colC,DATE_FORMAT(colDate,'%d-%m-%Y %T')
From.....
there are various %d-%m-%y you can use to display the date, weither you want month in name or number etc look at
www.mysql.com/doc/en/Date_and_time_functions.html
hope this helps
Iain
head hurts, 'mental note to self, stop banging head !'