php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24540 sqlite_seek()
Submitted: 2003-07-08 10:56 UTC Modified: 2003-07-08 18:43 UTC
Votes:4
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: info at php-power dot it Assigned: helly (profile)
Status: Closed Package: SQLite related
PHP Version: 5.0.0-dev OS:
Private report: No CVE-ID: None
 [2003-07-08 10:56 UTC] info at php-power dot it
Description:
------------
The function sqlite_seek() not return a requested line,
but the row successive.

Reproduce code:
---------------

$result = sqlite_query('SELECT * FROM test', $conn);

if (sqlite_seek($result, 1)) {
    $row = sqlite_current($result, SQLITE_NUM, true);
}

Expected result:
----------------
The first row of table.

Actual result:
--------------
The secon row of table.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-08 11:16 UTC] info at php-power dot it
Excused:
sqlite_seek() moves the pointer ahead to record requested

Example:

$sqlite_seek($result, 1);
sqlite_current($result);

result: 2 row of table

$sqlite_seek($result, 3);
sqlite_current($result);

result: 3 row of table

etc ...
 [2003-07-08 11:20 UTC] info at php-power dot it
I'm tired, naturally sqlite_seek() does not have the sign $

:)
 [2003-07-08 11:32 UTC] wez@php.net
So is it working?
If not, can you clarify what the problem is? :)

 [2003-07-08 11:45 UTC] info at php-power dot it
Thanks.

When I write sqlite_seek($result, 1); I creed that sqlite_cuttent() return the first line to a query,
but the second line is returned :|
 [2003-07-08 11:52 UTC] info at php-power dot it
Please,
they are 9 hours that I program :)
the example is:

Example:

sqlite_seek($result, 1);
sqlite_current($result);

return the row 2 of previous query

sqlite_seek($result, 3);
sqlite_current($result);

return the row 4 of previous query

etc ...

(this is the definitive example:P)
 [2003-07-08 13:59 UTC] helly@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2003-07-08 16:11 UTC] info at php-power dot it
Thanks to you for the great language.

I have noticed the bug why I am writing an SQLite class :)

I have asked aid in the mailing lists, but nobody has answered (the extension is too much recent??) :)

However thanks, in my class served me the functionality of sqlite_seek() hehehe


I am studying also English ^_^
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 13 02:01:27 2024 UTC