$data = true ;
$query1 = "SELECT count(attendence) as total_attendence
FROM employee
INNER JOIN attendence ON employee.emp_id = attendence.employee_id
if($data , 'where $this->action='$this->value' AND MONTH(date)=MONTH(CURDATE())','') ";
上面的SQL代碼的條件子句的功能是給我的錯誤使用「附近有if語句錯誤」如何,如果在SQL
'IF'不是在MySQL查詢允許。這是一廂情願的想法嗎? – tadman