From: jo3 at brats dot com Operating system: Red Hat Linux release 9 (Shrike) PHP version: 5.0.0b4 (beta4) PHP Bug Type: SQLite related Bug description: sqlite_fetch_array() produces blanks at the third and then every fourth call
Description: ------------ configured with --with-sqlite First execute a sqlite_query() which SELECTS from an sqlite database. Then determine the number of rows through a sqlite_num_rows() call. Then for each row, call slite_fetch_array() and then echo some data. The third fetch will be blank, then every fourth one after that. Reproduce code: --------------- slightly more than 20 lines but MOST are just the db inserts. url is http://gamera.brats.com/sqlite/testnum.php here is the script: <?php main(); /* just call main function */ function main() { $conn = sqlite_open("test.db"); if (!$conn) { echo "A Database Connection Error Occurred."; exit; } $qr = sqlite_query($conn, "DROP TABLE test1;"); $qr = sqlite_query($conn, "CREATE TABLE test1 (name character varying(80));"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo0');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo1');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo2');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo3');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo4');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo5');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo6');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo7');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo8');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo9');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo10');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo11');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo12');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo13');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo14');"); $qr = sqlite_query($conn, "INSERT INTO test1 VALUES('jo15');"); $test_result = sqlite_query($conn, "SELECT * FROM test1;"); $test_rows = sqlite_num_rows($test_result); for($i=0; $i < $test_rows; $i++) { $test_array = sqlite_fetch_array($test_result, $i); echo "name: " . $test_array["name"] . "<br>\n"; } } ?> Expected result: ---------------- name: jo0 name: jo1 name: jo2 name: jo3 name: jo4 name: jo5 name: jo3 name: jo7 name: jo8 name: jo9 name: jo10 name: jo11 name: jo12 name: jo13 name: jo14 name: jo15 Actual result: -------------- name: jo0 name: jo1 name: name: jo3 name: jo4 name: jo5 name: name: jo7 name: jo8 name: jo9 name: name: jo11 name: jo12 name: jo13 name: name: jo15 -- Edit bug report at http://bugs.php.net/?id=27621&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27621&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27621&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27621&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27621&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27621&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27621&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27621&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27621&r=support Expected behavior: http://bugs.php.net/fix.php?id=27621&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27621&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27621&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27621&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27621&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27621&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27621&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27621&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27621&r=float