3 回答
TA贡献1898条经验 获得超8个赞
$query = $this->db->conn->prepare('SELECT value, param FROM ws_settings WHERE name = ?');$query->bind_param('s', $setting);
prepare()
false
false
SELECT
WHERE
$this->db->conn->error_list
TA贡献1802条经验 获得超5个赞
“致命错误:对布尔值上的成员函数BIND_PARAM()的调用”
prepare()
FALSE
<?php
error_reporting(E_ALL);ini_set('display_errors', 1);
/var/log/apache2/error.log
tail -f /path/to/log
$sql = "SELECT `foo` FROM `weird_words` WHERE `definition` = ?";$query = $mysqli->prepare($sql)); // assuming $mysqli is the connection$query->bind_param('s', $definition);$query->execute();
prepare()
$sql = "SELECT `foo` FROM `weird_words` WHERE `definition` = ?";if($query = $mysqli->prepare($sql)) { // assuming $mysqli is the connection $query->bind_param('s', $definition); $query->execute(); // any additional code you need would go here.} else { $error = $mysqli->errno . ' ' . $mysqli->error; echo $error; // 1054 Unknown column 'foo' in 'field list'}
foo
TA贡献1868条经验 获得超4个赞
prepare
FALSE
True
$sql = 'SELECT value, param FROM ws_settings WHERE name = ?';if($query = $this->db->conn->prepare($sql)){ $query->bind_param('s', $setting); $query->execute(); //rest of code here}else{ //error !! don't go further var_dump($this->db->error);}
添加回答
举报