1--TEST-- 2mysqli_fetch_array() 3--SKIPIF-- 4<?php 5require_once('skipif.inc'); 6require_once('skipifconnectfailure.inc'); 7?> 8--FILE-- 9<?php 10 require('table.inc'); 11 12 if (!$res = mysqli_query($link, "SELECT * FROM test ORDER BY id LIMIT 5")) { 13 printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); 14 } 15 print "[002]\n"; 16 var_dump(mysqli_fetch_array($res, MYSQLI_ASSOC)); 17 mysqli_free_result($res); 18 19 if (!$res = mysqli_query($link, "SELECT id, label FROM test ORDER BY id LIMIT 5")) { 20 printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); 21 } 22 print "[004]\n"; 23 var_dump(mysqli_fetch_array($res, MYSQLI_ASSOC)); 24 mysqli_free_result($res); 25 26 mysqli_close($link); 27 print "done!"; 28?> 29--CLEAN-- 30<?php 31 require_once("clean_table.inc"); 32?> 33--EXPECT-- 34[002] 35array(2) { 36 ["id"]=> 37 string(1) "1" 38 ["label"]=> 39 string(1) "a" 40} 41[004] 42array(2) { 43 ["id"]=> 44 string(1) "1" 45 ["label"]=> 46 string(1) "a" 47} 48done! 49