Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2003
    Posts
    137

    Unanswered: why getting: argument for routine is not a variable?!

    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(aram_member_guid, aram_password_reset_guid)");
    $mysql_query->bindParam('aram_member_guid', $_SESSION["member_guid"], PDO::PARAM_STR);
    $mysql_query->bindParam('aram_password_reset_guid', $password_reset_guid, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 4000);

    $mysql_query->execute();

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Any triggers on that table by any chance?
    George
    Home | Blog

  3. #3
    Join Date
    Apr 2003
    Posts
    137
    no triggers...

    It's just a simple code as you can see..

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Moving to MySQL topic (happy to move back if prompted)
    George
    Home | Blog

  5. #5
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Inside your stored procedure you have declared the INOUT variable again. Remove that declaration of the variable.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •