php - Properly formatted MySQL date insert statement returns all 0's -


I have created a PHP script that parses an HTML page, creates a MySQL query, and parsed it in MySQL Includes data that contains the table. Everything is fine, except one thing: Date field. When PHP runs MySQL statement, the date is read 0000-00-00 in the table. If I resonate the MySQL query, the result is in the following:

  INSERT sending_table (sending / sending, Sending_time, dispatch 1, dispatch 2, dispatch 3, dispatch 4, dispatch 5, dispatch 6, dispatch 7, dispatch 8, dispatch 9, dispatch 10, sending 11, dispatch 12, sending 13, dispatch 14, dispatch 15, sending 16) Price ('2010-02-02', '10: 46: 17 ', '31.99', '32.15 ',' 32.24 ',' 32.39 ',' 33.46 ', '35.18', '39.33 ' , '39.39', '40.92', '41.79', '41.82', '44.35', '45.47', '46.89', '47.13' , '67.59');  

If I copy and paste the statement in the MySQL table, then it correctly inserts the date, but when PHP tries to insert it, give me all 0 goes. The send_data field is a "date" field in MySQL, before inserting a date with PHP code, the insert date is converted into a string (I thought it could solve my problem). Can anyone give me some information on this?

with tex com commencing

If you are out of range or enter the wrong format, MySQL will often enter the default value of all the zeros.

You're storing them in the wrong format.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -