致命错误:调用布尔值上的成员函数bindparam()
Fatal error: Call to a member function bind_param() on boolean in C:\xampp2\htdocs\application\classes\class.functions.php on line 16
getSetting
public function getSetting($setting){ $query = $this->db->conn->prepare('SELECT value, param FROM ws_settings WHERE name = ?'); $query->bind_param('s', $setting); $query->execute(); $query->bind_result($value, $param); $query->store_result(); if ($query->num_rows() > 0) { while ($query->fetch()) { return $value; if ($param === '1') { $this->tpl->createParameter($setting, $value); } } } else { __('invalid.setting.request', $setting); }}
$this->db
public function __construct($db, $data, $tpl){ $this->db = $db; $this->tpl = $tpl; $this->data = $data; $this->data->setData('global', 'theme', $this->getSetting('theme'));}
class Database{ private $data; public function __construct($data) { $this->data = $data; $this->conn = new MySQLi( $this->data->getData('database', 'hostname'), $this->data->getData('database', 'username'), $this->data->getData('database', 'password'), $this->data->getData('database', 'database') ); if ($this->conn->errno) { __('failed.db.connection', $this->conn->errno); } date_default_timezone_set('Europe/Amsterdam');}
'database' => array( 'hostname' => '127.0.0.1', 'username' => 'root', 'password' => ******, 'database' => 'wscript')
汪汪一只猫
12345678_0001
MYYA