Jump to content

MYSQL: How to set the date field in MYSQL DB to update to the date the record was added?


brainbug

Recommended Posts

I have an HTML form, and I can write to my MYSQL database by the help of PHP. I want the date to be set to the date the record was set as soon as a record is added. Is it possible with time, too? How exactly can we do that? An example would be very helpful. Thanks.

Link to comment
Share on other sites

you may like to read the http://w3schools.com/php/php_mysql_insert.asphttp://w3schools.com/php/php_mysql_update.aspyou need a date column in your database table when you will insert any records you can put timestamp using http://php.net/function.time in the date column.or you can set YYYY-MM-DD format using http://php.net/function.dateedit: broken links

Link to comment
Share on other sites

you may like to read the http://php.net/php/php_mysql_insert.html http://php.net/php/php_mysql_update.htmlyou need a date column in your database table when you will insert any records you can put timestamp using http://php.net/function.time in the date column.or you can set YYYY-MM-DD format using http://php.net/function.date
Thank you. I will check it out.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...