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 .