2010/05/26

mysql get month from UNIX TIME

Try to count total registers in a certain month from members table, but the regdate is in UNIX TIME STAMP. Here is a solution using MYSQL's function FROM_UNIXTIME

SELECT count( * ) FROM `members` WHERE month( FROM_UNIXTIME( `regdate` ) ) =12