Annotation of embedaddon/php/ext/mysqli/tests/mysqli_fetch_row.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: mysqli_fetch_row()
                      3: --SKIPIF--
                      4: <?php
                      5: require_once('skipif.inc');
                      6: require_once('skipifemb.inc');
                      7: require_once('skipifconnectfailure.inc');
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11:        require_once("connect.inc");
                     12: 
                     13:        $tmp    = NULL;
                     14:        $link   = NULL;
                     15: 
                     16:        if (!is_null($tmp = @mysqli_fetch_row()))
                     17:                printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
                     18: 
                     19:        if (!is_null($tmp = @mysqli_fetch_row($link)))
                     20:                printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
                     21: 
                     22:        require('table.inc');
                     23:        if (!$res = mysqli_query($link, "SELECT id, label, id AS _id FROM test ORDER BY id LIMIT 1")) {
                     24:                printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
                     25:        }
                     26: 
                     27:        print "[004]\n";
                     28:        var_dump(mysqli_fetch_row($res));
                     29: 
                     30:        print "[005]\n";
                     31:        var_dump(mysqli_fetch_row($res));
                     32: 
                     33:        mysqli_free_result($res);
                     34: 
                     35:        var_dump(mysqli_fetch_row($res));
                     36: 
                     37:        mysqli_close($link);
                     38:        print "done!";
                     39: ?>
                     40: --CLEAN--
                     41: <?php
                     42:        require_once("clean_table.inc");
                     43: ?>
                     44: --EXPECTF--
                     45: [004]
                     46: array(3) {
                     47:   [0]=>
                     48:   %unicode|string%(1) "1"
                     49:   [1]=>
                     50:   %unicode|string%(1) "a"
                     51:   [2]=>
                     52:   %unicode|string%(1) "1"
                     53: }
                     54: [005]
                     55: NULL
                     56: 
                     57: Warning: mysqli_fetch_row(): Couldn't fetch mysqli_result in %s on line %d
                     58: NULL
                     59: done!

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>