Call to undefined method PDO::bindParam()

后端 未结 3 2028
一整个雨季
一整个雨季 2020-12-11 15:58

Can someone tell me why I am getting this error? Call to undefined method PDO::bindParam()

Here is what I have, taken right off of PHPs site for stored procedures

3条回答
  •  不知归路
    2020-12-11 16:27

    The bindParam() function is a method of a PDOStatement object, not a PDO object. $stmt is an object of class PDO. You'll have to use the PDOStatement from your prepare() call instead.

    $pdo = db::getInstance();
    $stmt = $pdo->prepare("your query");
    $stmt->bindParam(2122, $return_value, PDO::PARAM_STR, 4000);
    

提交回复
热议问题