致命错误:在非对象中调用成员函数execute()

时间:2013-03-08 09:50:14

标签: function execute member

我试图在表格中插入一些值,但是我收到了这个错误:

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));

我试图寻找其他类似的问题,但找不到任何答案。谢谢你的帮助!

0 个答案:

没有答案