INSERT INTO错误PHP CODEIGNITER

时间:2017-05-14 15:08:52

标签: php codeigniter

screenshot

$sql = "INSERT INTO `waitinglist` (`reserver`, `roomNumber`, `hotelNumber`, `queueDepth`) 
        VALUES(".$this->db->escape($reserver).", ".$room.", ".$i.", ".$queueDepth+1.")";
$this->db->query($sql);

我做错了什么?

1 个答案:

答案 0 :(得分:0)

使用更好的编辑器/ IDE并突出显示错误,这很容易解决语法错误:

$sql = "INSERT INTO `waitinglist` (`reserver`, `roomNumber`, `hotelNumber`, `queueDepth`) 
        VALUES(".$this->db->escape($reserver).", ".$room.", ".$i.", ".($queueDepth+1).")";