$sql = "SELECT * FROM " . $im . "data as d , " . $im. "import as m WHERE d.idimport=m.id AND d.cate_type='2' AND DATE_FORMAT(d.date_create, '%Y-%m') = '".date('Y-m')."' ORDER BY d.date_create DESC ";
เดือนที่ผ่านมา Code
$sql = "SELECT * FROM " . $im . "data as d , " . $im. "import as m WHERE d.idimport=m.id AND d.cate_type='2' AND DATE_FORMAT(d.date_create, '%Y-%m') = '".date('Y-m', strtotime('-1 month'))."' ORDER BY d.date_create DESC ";