- Forums
- MYSQL
- How To Insert Current Date And Time Into Mysql
Inserting The Current Date And Time Into Mysql Database Table Is Easy If You Do This Query On Your Mysql Database [2311], Last Updated: Mon Jun 24, 2024
Webune Tutorials
Thu Oct 29, 2009
0 Comments
487 Visits
Hello
Welcome to Webune Support Forums. We provide MySQL database hosting for Dynamic Websites. if you are not happy with your current hosting provider, we recommend you switch to Webune Today.
Today we are going to show you how easy it is to inster the current time and date into your MySQL queries using PHP. for example, you can use this simple query to do what you are looking for.. here it is:
PHP CODE:
$sql = "INSERT INTO log(time) values (now())'"
another way you can do the same query is by doing it like this:
PHP CODE:
$sql = "INSERT INTO log SET time = now()"
does this help?