调用成员函数bind_param()

时间:2011-05-26 18:34:11

标签: mysql database mysqli

我想更新表用户的某些字段,但是我收到此错误:

致命错误:在第79行的C:\ Users \ fel \ VertrigoServ \ www \ login \ thumb.php中的非对象上调用成员函数bind_param()

代码中是否存在语法错误?

 $user=2;
    ($sql = $db -> prepare('UPDATE users SET (profile_photo, update_photo) VALUES (?, ?) where id_user=?'));

    $sql -> bind_param('ssi', $thumbnailPath, $thumbnailPathMin, $user); //line 79

    $sql -> execute();

感谢

1 个答案:

答案 0 :(得分:-1)

解决

($sql = $db -> prepare('UPDATE users SET profile_photo = ?, update_photo=?  where id_user=?'));