mysqli_fetch_row.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --TEST--
  2. mysqli_fetch_row()
  3. --SKIPIF--
  4. <?php
  5. require_once('skipif.inc');
  6. require_once('skipifemb.inc');
  7. require_once('skipifconnectfailure.inc');
  8. ?>
  9. --FILE--
  10. <?php
  11. require_once("connect.inc");
  12. $tmp = NULL;
  13. $link = NULL;
  14. if (!is_null($tmp = @mysqli_fetch_row()))
  15. printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
  16. if (!is_null($tmp = @mysqli_fetch_row($link)))
  17. printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
  18. require('table.inc');
  19. if (!$res = mysqli_query($link, "SELECT id, label, id AS _id FROM test ORDER BY id LIMIT 1")) {
  20. printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
  21. }
  22. print "[004]\n";
  23. var_dump(mysqli_fetch_row($res));
  24. print "[005]\n";
  25. var_dump(mysqli_fetch_row($res));
  26. mysqli_free_result($res);
  27. var_dump(mysqli_fetch_row($res));
  28. mysqli_close($link);
  29. print "done!";
  30. ?>
  31. --CLEAN--
  32. <?php
  33. require_once("clean_table.inc");
  34. ?>
  35. --EXPECTF--
  36. [004]
  37. array(3) {
  38. [0]=>
  39. %unicode|string%(1) "1"
  40. [1]=>
  41. %unicode|string%(1) "a"
  42. [2]=>
  43. %unicode|string%(1) "1"
  44. }
  45. [005]
  46. NULL
  47. Warning: mysqli_fetch_row(): Couldn't fetch mysqli_result in %s on line %d
  48. NULL
  49. done!