My query currently gets yesterdays data but I now want to get all of last months data. (E.g.from 1st to 31st)
$res = mysql_query("SELECT
FROM_UNIXTIME( enquiry_time ), `id` ,
`fullname` , `address1` , `citytown` ,
`postcode` , `telno` ,
`property_value` ,`total_secured_debt`
, `email` , `on_market` , `agent` ,
`reason` , `price_concession` ,
`asking_price` , `form_page` FROM
$table WHERE TO_DAYS(FROM_UNIXTIME( enquiry_time )) = (TO_DAYS(NOW())-1)
");
There is not a TO_MONTHS so im not sure where to start!