Answered
datetime or timestamp? help please
Hi,
I am trying to make a simple system to add news articles to my clubs website (www.paekakarikisurflifeguards.com).
Basically what I would like to happen is this:
The person responsibile for the news updates fills out the form with the required details - title, body and then when they click 'add' the article is saved to the database. At this point I would like the date and time to automatically be stored in the database as well (in a field called 'date' funnily enough 🙂 )
I am unsure whether the data type of the field 'date' should be 'datetime' or 'timestamp' and furthermore how exactly I would get the database to use the current date/time as the value for that field when the article is added.
I realise this may seem simple and Im sure there is an easy way to do it however I am not very experienced with mysql/php so any help would be greatly appreciated.
Thank you in advance,
Drew
I am trying to make a simple system to add news articles to my clubs website (www.paekakarikisurflifeguards.com).
Basically what I would like to happen is this:
The person responsibile for the news updates fills out the form with the required details - title, body and then when they click 'add' the article is saved to the database. At this point I would like the date and time to automatically be stored in the database as well (in a field called 'date' funnily enough 🙂 )
I am unsure whether the data type of the field 'date' should be 'datetime' or 'timestamp' and furthermore how exactly I would get the database to use the current date/time as the value for that field when the article is added.
I realise this may seem simple and Im sure there is an easy way to do it however I am not very experienced with mysql/php so any help would be greatly appreciated.
Thank you in advance,
Drew
