Jump to content

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


brainbug
 Share

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.

Edited by BrainBUG
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

Edited by birbal
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...