PageRenderTime 71ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/good/ext/mysqli/tests/bug42548.php

http://github.com/facebook/hiphop-php
PHP | 47 lines | 41 code | 6 blank | 0 comment | 10 complexity | 865f130f352f115615dbc2464b2d36c3 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. require_once('connect.inc');
  3. $mysqli = mysqli_init();
  4. $mysqli->real_connect($host, $user, $passwd, $db, $port, $socket);
  5. if (mysqli_connect_errno()) {
  6. printf("Connect failed: %s\n", mysqli_connect_error());
  7. exit();
  8. }
  9. $mysqli->query("DROP PROCEDURE IF EXISTS test_bug42548_procedure_1") or die($mysqli->error);
  10. $mysqli->query("CREATE PROCEDURE test_bug42548_procedure_1() BEGIN SELECT 23; SELECT 42; END") or die($mysqli->error);
  11. if ($mysqli->multi_query("CALL test_bug42548_procedure_1();"))
  12. {
  13. do
  14. {
  15. if ($objResult = $mysqli->store_result()) {
  16. while ($row = $objResult->fetch_assoc()) {
  17. print_r($row);
  18. }
  19. $objResult->close();
  20. if ($mysqli->more_results()) {
  21. print "----- next result -----------\n";
  22. }
  23. } else {
  24. print "no results found\n";
  25. }
  26. } while ($mysqli->more_results() && $mysqli->next_result());
  27. } else {
  28. print $mysqli->error;
  29. }
  30. $mysqli->query("DROP PROCEDURE test_bug42548_procedure_1") or die($mysqli->error);
  31. $mysqli->close();
  32. print "done!";
  33. ?>
  34. <?php error_reporting(0); ?>
  35. <?php
  36. require_once("connect.inc");
  37. if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
  38. printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
  39. mysqli_query($link, "DROP PROCEDURE IF EXISTS test_bug42548_procedure_1");
  40. mysqli_close($link);
  41. ?>