PHP stored procedure call example

WBOY
Release: 2016-07-25 09:05:26
Original
1240 people have browsed it
  1. //For example, the stored procedure to be called is gxtj(a,b)

  2. $db=new mysqli("localhost","ssss","aaaaa","bbbb");
  3. mysqli_query($db,"SET NAMES utf8");
  4. $result=$db->query("call gxtj($year,$jd)"); // gxtj is the stored procedure name of mysql [color=gray] [/color]
  5. while( $row = $result->fetch_array(MYSQLI_ASSOC)) //Complete fetching a row from the returned result set
  6. {
  7. while ($key=key($row)){ //Get the field names in sequence
  8. $value=current($row); //Get field values ​​in sequence
  9. }
  10. }

Copy code


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!