[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

PHP SQL insert current date statement

What is the statement and value setting for inserting current date to DB using PHP.

 $sql = "INSERT INTO userTable (reg_date) VALUES (?????????)";

Open in new window

0
yaron89
Asked:
yaron89
1 Solution
 
deviprasadgCommented:
For MySQL use now().

 $sql = "INSERT INTO userTable (reg_date) VALUES (NOW())";


Refer:
http://stackoverflow.com/questions/7574656/how-to-generate-and-insert-datetime-into-a-mysql-database-php
0
 
yaron89Author Commented:
NOW() is for current datetime
I found  CURDATE()  for current date
Thanks
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now