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
$stmt = db::getInstance();
$stmt->prepare("CALL delete(?)");
$stmt->bindParam(2122, $return_value, PDO::PARAM_STR, 4000);
$stmt->execute();
print "procedure returned $return_value\n";
The bindParam()
method is inside the PDOStatement
class, not the PDO class. The statement is the result of the prepare()
method.
$foo = db::getInstance();
$stmt = $foo->prepare("CALL delete(?)");
$stmt->bindParam(2122, $return_value, PDO::PARAM_STR, 4000);
$stmt->execute();
print "procedure returned $return_value\n";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With