Answer the question
In order to leave comments, you need to log in
How to add your date in mysql?
Hello!
It is not possible to add a date in MySQL to the DATE format string The
request does not cause errors, but also the affected rows - 0
INSERT INTO `oc_product` (`product_id`, date_available) VALUES (100014, 2000-01-02) ON DUPLICATE KEY UPDATE `product_id` = VALUES(`product_id`), `date_available` = VALUES(`date_available`);
INSERT INTO `oc_product` (`product_id`, date_available) VALUES (100014, STR_TO_DATE(2000-01-02, %Y,%m,%d)) ON DUPLICATE KEY UPDATE `product_id` = VALUES(`product_id`), `date_available` = VALUES(`date_available`);
$date_added_1 = date_create_from_format('d-m-Y', "02-01-2000");
$date_added = date_format($date_added_1, 'Y-m-d ');
Answer the question
In order to leave comments, you need to log in
Try reverse programming. Through phpmyadmin you create several records in the table. Export the records from the database to sql code. Read it, see how the query is built, the fields and values are indicated. Trying to run this query with your data. After understanding this, you will understand how to create requests in php and other languages.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question