View Full Version : Field type problem
02-08-2006, 09:07 AM
i set field"start date" as DATE
but when i enter date formate like 2006-10-28
the data cannot be entereed
0000-00-00 is recorded
are you talking about MySQL? Wrong Forum?
maybe we can see some code? maybe the query? maybe a description of that table?
02-08-2006, 11:09 AM
CREATE TABLE mw_test(
id INT(15) AUTO_INCREMENT NOT NULL,
Then i do one mysql insert
$sql=$db->query("INSERT INTO mw_test VALUES(NULL,'2006-10-22')");
then you check the phpmyadmin you will discover that the inserted todaydate is 0000-00-00
try changing your query to
sql=$db->query("INSERT INTO mw_test (todaydate) VALUES('2006-10-22')");
or run this inside the phpMyAdmin querywindow:
INSERT INTO mw_test (todaydate) VALUES('2006-10-22')
02-08-2006, 01:57 PM
can i enter value like DD-MM-YYYY
you can try, and MySQL will try to interpret it, but there is no guarantee that this interpretation will be correct. For instance, should 01-02-2005 be the first of februari or the second januari?
MySQL doesn't realy have a way of telling that, so it's not a good idea.
Did you try the suggestions i posted + what was the result?
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.