Hi,
I am trying to get an INOUT parameter from MySQl using PHP and PDO but getting:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1414 OUT or INOUT argument 2 for routine xoompage.sp_send_password_reset is not a variable or NEW pseudo-variable in BEFORE trigger' in C:\\xampp\\htdocs\\xoompage\\password_reset.php:17 Stack trace: #0 C:\\xampp\\htdocs\\xoompage\\password_reset.php(17): PDOStatement->execute() #1 {main} thrown in C:\\xampp\\htdocs\\xoompage\\password_reset.php on line 17
here is MySQL sp:
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_send_password_reset`(IN param_member_guid varchar(255), INOUT param_password_reset_guid varchar(255))
BEGIN
DECLARE param_password_reset_guid varchar(255);
SET param_password_reset_guid = UUID();
UPDATE members SET password_reset_guid = param_password_reset_guid, password_reset_date = DATE(NOW()) WHERE member_guid = param_member_guid;
END
and this is the PHP:
$mysql_query = $mysql_connection->prepare("CALL sp_send_password_reset(:param_member_guid, :param_password_reset_guid)");
$mysql_query->bindParam(':param_member_guid', $_SESSION["member_guid"], PDO::PARAM_STR);
$mysql_query->bindParam(':param_password_reset_guid', $password_reset_guid, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 4000);
$mysql_query->execute();