PHP 如何获取存储过程的返回值

WBOY
Release: 2016-06-23 14:20:27
Original
1370 people have browsed it

	$query = "CALL T_PROCEDURE_GETPHONE($pid,@phone)";		$conn->query($query);		$query1 = 'SELECT @phone';		$result = $conn->query($query1);		$rr = $result->fetch_row();
Copy after login

$result->num_rows 返回是1

而且用cmd 来调用函数, 返回的是有号码的.
但是在PHP中,返回的就什么都没有了


回复讨论(解决方案)

$result->num_rows 返回是1 说明有一条记录

echo $rr[0];
Copy after login

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!