
php inserting date into mysql

Here is a php code that inserts date into mysql database. In the given code, data is a database table.
<?php
table
$query_manual = "INSERT INTO data (dp_name, dp_date)
VALUES ('DATE: Manual Date', '2020-2-14')";
$query_auto = "INSERT INTO data(dp_name, dp_date)
VALUE ('DATE: Auto CURDATE()', CURDATE() )";
mysql_query($query_manual) or die(mysql_error());
mysql_query($query_auto) or die(mysql_error());
?>

For inserting date into MYSQL database use this following code, $queryauto = "INSERT INTO tablename (colname, col_date) VALUE ('DATE: Auto CURDATE()', CURDATE() )";
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.