Annotation of embedaddon/php/ext/mysql/tests/mysql_fetch_row.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: mysql_fetch_row()
3: --SKIPIF--
4: <?php
5: require_once('skipif.inc');
6: require_once('skipifconnectfailure.inc');
7: ?>
8: --FILE--
9: <?php
10: include "connect.inc";
11:
12: $tmp = NULL;
13: $link = NULL;
14:
15: if (!is_null($tmp = @mysql_fetch_row()))
16: printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
17:
18: if (NULL !== ($tmp = @mysql_fetch_row($link)))
19: printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
20:
21: require('table.inc');
22: if (!$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:
26: print "[004]\n";
27: var_dump(mysql_fetch_row($res));
28:
29: print "[005]\n";
30: var_dump(mysql_fetch_row($res));
31:
32: mysql_free_result($res);
33:
34: var_dump(mysql_fetch_row($res));
35:
36: mysql_close($link);
37: print "done!";
38: ?>
39: --CLEAN--
40: <?php
41: require_once("clean_table.inc");
42: ?>
43: --EXPECTF--
44: [004]
45: array(2) {
46: [0]=>
47: %unicode|string%(1) "1"
48: [1]=>
49: %unicode|string%(1) "a"
50: }
51: [005]
52: bool(false)
53:
54: Warning: mysql_fetch_row(): %d is not a valid MySQL result resource in %s on line %d
55: bool(false)
56: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>