带有3个WHERE子句的MYSQL SELECT

时间:2012-08-26 19:52:21

标签: select mysqli where-clause

我遇到此代码的问题

$set = 'mycrazyemail@gmail.com'
$check_is_idk = $db->query("SELECT * FROM `ppl` WHERE `email` = '{$set}' AND `is` = 'idk' AND `belongs` = '{$id}'");

问题是什么?

1 个答案:

答案 0 :(得分:1)

你在第一行末尾缺少一个分号,它当前导致一个解析错误:

$set = 'mycrazyemail@gmail.com';
$check_is_idk = $db->query("SELECT * FROM `ppl` WHERE `email` = '{$set}' AND `is` = 'idk' AND `belongs` = '{$id}'");