|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2014-02-01 10:17 UTC] krakjoe@php.net
 
-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: krakjoe
  [2014-02-01 10:17 UTC] krakjoe@php.net
  [2014-02-01 13:28 UTC] salathe@php.net
 
-Status:      Closed
+Status:      Re-Opened
-Assigned To: krakjoe
+Assigned To:
  [2014-02-01 13:28 UTC] salathe@php.net
  [2015-08-31 16:39 UTC] cmb@php.net
  [2017-10-24 23:31 UTC] kalle@php.net
 
-Status: Re-Opened
+Status: Suspended
  [2017-10-24 23:31 UTC] kalle@php.net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 22:00:01 2025 UTC | 
Description: ------------ In PHP 5.2 the test script below works fine, but in PHP 5.3 it does not work. As far as I know this difference is not documented. To make the script work in PHP 5.3, you would have to move the sqlite_close command to the end of the script or comment it out. It seems to me that the return handle ($res in the test script) does not survive sqlite_close in PHP 5.3. But I am not savvy enough to be sure about this. Test script: --------------- <?php $db = sqlite_open('path/to/database'); $sql = "SELECT * FROM mytable"; $res = sqlite_query($sql, $db); sqlite_close($db); while ( $thisRow = sqlite_fetch_array($res) ) { print_r($thisRow); } ?> Expected result: ---------------- The documentation should be clear about this difference. Due to potential concurrency problems in SQLite, developers may have chosen to close the database handle ASAP in their PHP 5.2 scripts. While upgrading to PHP 5.3 they may need a hint that "ASAP" has changed. Actual result: -------------- PHP 5.2: Every row in mytable is printed out via print_r() PHP 5.3: "Warning: sqlite_fetch_array(): 3 is not a valid sqlite result resource in /server/path/test-script.php on line 8"