MYSQL,存储过程
CREATE DEFINER=`trip_admin`@`localhost` PROCEDURE `outtemp`(OUT `p_outtext` VARCHAR(100))proc:BEGIN set p_outtext='测试'; insert into temp (tp) value (p_outtext);END
$DSN = "$DBMS:host=$HOST;dbname=$DBName"; $pdo = new PDO($DSN,$UserName,$PassWord); $pdo -> query("set names uft8"); $result=$pdo->prepare("call outtemp (?)"); $result->bindParam(1,$result_text,PDO::PARAM_STR,100); $result->execute();
研究出来怎么回事。也解决带多个IN和OUT参数的存储过程,用PDO怎么调用和取得返回值了。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号