📅  最后修改于: 2022-03-11 15:04:54.203000             🧑  作者: Mango
/* You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
You get the above error when you are concatenating a NULL variable in your SQL Statement
I fixed mine by adding an if statement to check if the possible variable is NULL*/
if($admin_data['hotel_id'] != NULL){
$sql .= " AND hotel_id =".$admin_data['hotel_id'];
}
-- But it is STRONGLY advised to avoid this style of coding since it is vulnerable to SQL Injecton Attacks