Tags
Asked 3 years ago
13 Jul 2021
Views 399
Santiago

Santiago posted

How can I insert current date and time in PHP ?

How can I insert current date and time in PHP ?
where you want to insert current date and time in PHP ? - Oral  
Nov 30 '-1 00:00
iptracker

iptracker
answered Aug 19 '21 00:00

if you want to insert the current date and time from PHP to MySQL database then the following code is helpful :


$insert="insert into tablename (`datetime`) values('NOW()')";
$mysqli->query(($insert);


NOW() is function at MySQL which return current server's date and time
put NOW() as above in the insert query to insert date and time into the field.and execute the insert query statement .
Post Answer