我试图在我的表中插入一些值,但我收到了这个错误:
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));
我尝试搜索类似这样的其他问题,但找不到任何答案。谢谢您的帮助!