1--TEST-- 2mysql_fetch_lengths() 3--SKIPIF-- 4<?php 5require_once('skipif.inc'); 6require_once('skipifconnectfailure.inc'); 7?> 8--FILE-- 9<?php 10include "connect.inc"; 11 12$tmp = NULL; 13$link = NULL; 14 15if (!is_null($tmp = @mysql_fetch_lengths())) 16 printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); 17 18if (NULL !== ($tmp = @mysql_fetch_lengths($link))) 19 printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); 20 21require('table.inc'); 22if (!$res = mysql_query("SELECT id, label FROM test ORDER BY id LIMIT 1", $link)) { 23 printf("[003] [%d] %s\n", mysql_errno($link), mysql_error($link)); 24} 25 26while ($row = mysql_fetch_assoc($res)) 27 var_dump(mysql_fetch_lengths($res)); 28var_dump(mysql_fetch_lengths($res)); 29 30mysql_free_result($res); 31 32var_dump(mysql_fetch_lengths($res)); 33 34mysql_close($link); 35print "done!"; 36?> 37--CLEAN-- 38<?php 39require_once("clean_table.inc"); 40?> 41--EXPECTF-- 42array(2) { 43 [0]=> 44 int(1) 45 [1]=> 46 int(1) 47} 48bool(false) 49 50Warning: mysql_fetch_lengths(): %d is not a valid MySQL result resource in %s on line %d 51bool(false) 52done! 53