Home >Backend Development >PHP Tutorial >PHP stored procedure call example

PHP stored procedure call example

WBOY
WBOYOriginal
2016-07-25 09:05:261295browse
  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


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