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--
42Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d
43array(2) {
44  [0]=>
45  int(1)
46  [1]=>
47  int(1)
48}
49bool(false)
50
51Warning: mysql_fetch_lengths(): %d is not a valid MySQL result resource in %s on line %d
52bool(false)
53done!
54