1--TEST--
2mysql_fetch_row()
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_row()))
16	printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
17
18if (NULL !== ($tmp = @mysql_fetch_row($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
26print "[004]\n";
27var_dump(mysql_fetch_row($res));
28
29print "[005]\n";
30var_dump(mysql_fetch_row($res));
31
32mysql_free_result($res);
33
34var_dump(mysql_fetch_row($res));
35
36mysql_close($link);
37print "done!";
38?>
39--CLEAN--
40<?php
41require_once("clean_table.inc");
42?>
43--EXPECTF--
44[004]
45array(2) {
46  [0]=>
47  %unicode|string%(1) "1"
48  [1]=>
49  %unicode|string%(1) "a"
50}
51[005]
52bool(false)
53
54Warning: mysql_fetch_row(): %d is not a valid MySQL result resource in %s on line %d
55bool(false)
56done!