Updating/Adding A Date

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
icesolid
Forum Regular
Posts: 502
Joined: Mon May 06, 2002 9:36 pm
Location: Buffalo, NY

Updating/Adding A Date

Post by icesolid »

Updating or Adding dates to my database is not working.

Fields:

id INT(11)
date_ordered DATE (default 0000-00-00)

Code: Select all

mysql_query("UPDATE cases SET date_ordered='2006-03-11' WHERE id='1'");
Same with my insert query:

Code: Select all

mysql_query("INSERT INTO cases SET date_ordered='2006-03-11'");
User avatar
R4000
Forum Contributor
Posts: 168
Joined: Wed Mar 08, 2006 12:50 pm
Location: Cambridge, United Kingdom

Post by R4000 »

Code: Select all

mysql_query("INSERT INTO cases (date_ordered) VALUES ('2006-03-11');");
icesolid
Forum Regular
Posts: 502
Joined: Mon May 06, 2002 9:36 pm
Location: Buffalo, NY

Post by icesolid »

What about the update query?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

what does MySQL say about your update? mysql_error(), mysql_affected_rows()
Post Reply