我的代码不起作用,我无法弄清楚原因
public function fetch_active_table_data(){
$query = "SELECT id, name, location, admission, drink_prices, Performer FROM drinkdeals WHERE admission IS NULL";
$stmt = $this->dbh->prepare($query);
$stmt->execute(array("0"));
我试图只显示录取为空的事件。我究竟做错了什么?谢谢,基兰
编辑:当我删除WHERE admission IS NULL
时它确实有用,所以我知道问题出在哪里。感谢
答案 0 :(得分:0)
这取决于您如何设置值。也许你应该尝试寻找一个空值,如:
public function fetch_active_table_data(){
$query = "SELECT id, name, location, admission, drink_prices, Performer FROM drinkdeals WHERE admission=''";
$stmt = $this->dbh->prepare($query);
$stmt->execute(array("0"));
}