real_query("call sp_test()")){       &"/> real_query("call sp_test()")){       &">

为啥php调用存储过程返回多个结果集,总要多出一个结果集

WBOY
Release: 2016-06-13 12:44:02
Original
866 people have browsed it

为什么php调用存储过程返回多个结果集,总要多出一个结果集
比如
$db->query("SET NAMES UTF8");   
if($db->real_query("call sp_test()")){   
    do{   
        echo 'bp';
        if($result = $db->store_result()){   
            while ($row = $result->fetch_assoc()){   
                array_push($rows, $row);   
            }   
            $result->close();   
        }   
    }while($db->next_result());   
}   
$db->close(); 

你会发现假设你返回1个结果集,会打出2个bp,2个结果集就会echo出3个bp,但如果不写存储,直接写语句,就正常,不会多出一个,求大神指点迷津!

Related labels:
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!