我试图在表格中插入一些值,但是我收到了这个错误:
Fatal error: Call to a member function execute() on a non-object in C:\wamp\www\Diploma\Clire\login-edit_file.php on line 35
我的表是:
param_string, inside is idstring, fileid, key and value.
代码是
if (startsWith($key, "text_"))
$query = $DB->prepare("INSERT INTO param_string (fileid, key, value) VALUES (?, ?, ?)") or die();
$query->execute(array($file_id, $key, $value));
if (startsWith($key, "boolean_"))
$query = $DB->prepare("INSERT INTO param_string (fileid, key, value) VALUES (?, ?, ?)") or die();
$query->execute(array($file_id, $key, $value));
我试图寻找其他类似的问题,但找不到任何答案。谢谢你的帮助!