получаю в пхп начало предыдущего месяца и его конец
Код: Выделить всё
$lastmonth1 = mktime(0, 0, 0, date("m")-1, date("01"),date("Y"));
$lastmonth2 = mktime(0, 0, 0, date("m"), 1, date("Y"));
$res_service = mysql_query ("SELECT discount, slink_id, discount_date, discount_period_id,account_id, services_data.service_name AS sname, services_data.service_type, charge_type, discount_with_tax FROM discount_transactions_all, services_data WHERE discount_transactions_all.account_id='$id' AND services_data.id=discount_transactions_all.service_id AND discount_date>='$lastmonth1' AND discount_date <='$lastmonth2' AND (discount_transactions_all.service_type='2' OR discount_transactions_all.service_type='1' OR charge_type='1' OR charge_type='2') ORDER BY discount_date DESC", $link);
Помогите плиз...