mysql.php 592 B

123456789101112131415161718192021222324252627
  1. <?php
  2. $db = new mysqli;
  3. $db->connect('127.0.0.1', 'root', 'root', 'test');
  4. $db->query("show databases", MYSQLI_ASYNC);
  5. sleep(1);
  6. if ($result = $db->reap_async_query())
  7. {
  8. print_r($result->fetch_row());
  9. if(is_object($result))
  10. {
  11. mysqli_free_result($result);
  12. }
  13. }
  14. else die(sprintf("MySQLi Error: %s", mysqli_error($link)));
  15. $db->query("show tables", MYSQLI_ASYNC);
  16. sleep(1);
  17. if ($result = $db->reap_async_query())
  18. {
  19. print_r($result->fetch_row());
  20. if(is_object($result))
  21. {
  22. mysqli_free_result($result);
  23. }
  24. }
  25. else die(sprintf("MySQLi Error: %s", mysqli_error($link)));