There is no direct “last day of the month”, but you can fake it by doing the day (last_day ())
mysql> select last_day('2012-02-22'), day(last_day('2012-02-22'));
+------------------------+-----------------------------+
| last_day('2012-02-22') | day(last_day('2012-02-22')) |
+------------------------+-----------------------------+
| 2012-02-29 | 29 |
+------------------------+-----------------------------+
1 row in set (0.00 sec)
last_day()returns the full date of the last day in the year / month of the specified date, so you simply use day()this last_day to retrieve the day.
The documentation for MySQL date and time functions is given here: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html