bindParam(1, $name); $stmt->bindParam(2, $return_value, PDO::P"/> bindParam(1, $name); $stmt->bindParam(2, $return_value, PDO::P">

Home >Backend Development >PHP Tutorial > PHP_PDO 调用存储过程,返回参数有关问题

PHP_PDO 调用存储过程,返回参数有关问题

WBOY
WBOYOriginal
2016-06-13 12:32:00896browse

PHP_PDO 调用存储过程,返回参数问题

$stmt = $db->prepare("CALL pro_test(?,@?)");<br />
		$stmt->bindParam(1, $name);<br />
		$stmt->bindParam(2, $return_value, PDO::PARAM_STR, 4000);<br />
		<br />
<br />
		// 插入一行<br />
		$name = '成都市';<br />
		$stmt->execute ();<br />
<br />
		print_r($return_value);


调用存储过程,返回参数怎么是空的,么有,查看数据库,已经成功添加了数据,
直接在数据库中执行
SET @n = -1;
CALL pro_test("啊是打算",@n);
select @n;
返回的都是正确的参数

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn