In PHP, the call to a stored procedure fails in PDO mode.

Source: Internet
Author: User
MYSQL, stored procedures
CREATE definer= ' trip_admin ' @ ' localhost ' PROCEDURE ' outtemp ' (out ' P_outtext ' VARCHAR ()) Proc:begin    set P_ outtext= ' testing ';    INSERT INTO TEMP (TP) value (P_outtext); END


Table temp, just a TP field.

Php,pdo way, call this stored procedure, no return value, table also does not add data.
$DSN = "$DBMS: host= $HOST;d bname= $DBName"; $pdo = new PDO ($DSN, $UserName, $PassWord); $pdo, query ("Set names Uft8"); $ result= $pdo->prepare ("Call Outtemp (?)"); $result->bindparam (1, $result _text,pdo::P aram_str,100); $result->execute ();


Environment:
Windows Server x64
MySQL 5.6.19
PHP 5.5.14


Reply to discussion (solution)

What's going on here. A stored procedure with multiple in and out parameters is also resolved, and the return value is called and obtained with PDO.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.