|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36117 posbile bug sqlite_prev
Submitted: 2006-01-21 19:48 UTC Modified: 2006-01-22 14:04 UTC
From: alejosimon at yahoo dot com dot ar Assigned:
Status: Not a bug Package: SQLite related
PHP Version: 5.1.2 OS: Win 2k3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: alejosimon at yahoo dot com dot ar
New email:
PHP Version: OS:


 [2006-01-21 19:48 UTC] alejosimon at yahoo dot com dot ar
Actualmente estoy usando PHP 5.1.2 for win32 en windows 2k3, y experimento un bucle interminable.

Puede ser esto un bug ???


Reproduce code:
$db_res = db_query( $db, " SELECT * FROM clientes " ) ;

while ( $db_reg = db_fetch_array( $db_res ) ) {

   echo "1ro: " . $db_reg['cliente'] . "<br>" ;

   db_next( $db_res ) ;
   $db_reg = db_current( $db_res ) ;

   echo "2do: " . $db_reg['cliente'] . "<br>" ;

   db_prev( $db_res ) ; // aca esta el problema.


Expected result:
sumar un registro para verificarlo, y luego retroceder para seguir con el while. 

Actual result:
bucle interminable.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-21 20:15 UTC]
Please use English for bug reports.
 [2006-01-21 22:20 UTC] alejosimon at yahoo dot com dot ar
Sorry!!! :(

... but please! run this php code and view the problem.

 [2006-01-21 22:25 UTC] alejosimon at yahoo dot com dot ar
SORRY 2 :) !!!

all functions with prfix "db_" are equivalent to "sqlite_" functions. Rewrite the code.

$db_res = sqlite_query( $db, " SELECT * FROM clientes " ) ;

while ( $db_reg = sqlite_fetch_array( $db_res ) ) {

   echo "1ro: " . $db_reg['cliente'] . "<br>" ;

   sqlite_next( $db_res ) ;
   $db_reg = sqlite_current( $db_res ) ;

   echo "2do: " . $db_reg['cliente'] . "<br>" ;

   sqlite_prev( $db_res ) ; // aca esta el problema.

 [2006-01-21 22:38 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

 [2006-01-21 22:39 UTC]
And try to describe the problem.
 [2006-01-22 06:22 UTC] judas dot iscariote at gmail dot com
Tony : I speak Spanish :-)

He is trying to say, that the code above is getting into an infinite loop, however I think this bug is quite bogus.

to the OP:
you should read some tutorial like

and use sqlite extension in the Object oriented way. or even better, use pdo_sqlite.

if one of the suggested examples crashes for you please reopen this bug.
 [2006-01-22 14:04 UTC]
Feel free to reopen when you have a decent description and reproduce code.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 23:01:28 2024 UTC