tags:

views:

34

answers:

2

I have some problem whith such mysql_query

INSERT INTO table VALUES ('', CURDATE()-1)

why if yesteday is last day of the month

the CURDATE()-1) result is like 2010-04-00

why not 2010-03-31

+1  A: 

What about the DATE_ADD function?

Rhapsody
+2  A: 

When you mix date and number, date is treated as number.

Try:

INSERT INTO table VALUES ('', date_sub(CURDATE(), interval 1 day));
mcabral