Hi can someone help me with this problem?
I have a stored procedure which is inserting a record in one table and updating some other tables. One record will be returned. Called from the mysql workbench it works flawless.
When I use the code underneath (PHP using DBO) I get an error. I don't see the problem (probably staring blind).
public function ChangePassword($email, $password, $newPassword ) {
try {
$ip = getRealIpAddr();
$stmt = $this->prepare("call STP_Set_Password(?, ?, ? ,? )");
$stmt->bindvalue(1,$email,PDO::PARAM_STR);
$stmt->bindvalue(2,$password,PDO::PARAM_STR);
$stmt->bindvalue(3,$newPassword,PDO::PARAM_STR);
$stmt->bindvalue(3,$ip,PDO::PARAM_STR);
echo "call STP_Set_Password($email, $password, $newPassword, $ip)<br>";
$stmt->execute();
$itemlist = $stmt->fetchall();
var_dump($itemlist);
return $itemlist;
} catch (PDOException $e) {
echo 'Database reports an error: ' . $e->getMessage();
}
}
Passwords are hashes. The code echo's the call to the stored procedure. This does run when I copy it to the mysql workbench.