Re: How to retrieve the position of a row inside a table with garbage data in all cloumns?

From: Date: Tue, 23 Sep 2008 07:18:03 +0000
Subject: Re: How to retrieve the position of a row inside a table with garbage data in all cloumns?
References: 1 2 3 4 5 6  Groups: php.db 
Request: Send a blank email to php-db+get-45444@lists.php.net to get a copy of this message
Trullo wrote:
On Tue, Sep 23, 2008 at 6:58 AM, Chris <dmagick@gmail.com> wrote:
To the OP: why does it matter where the row appears in the list?
In the case i'm facing it doesn't matter, but it could be useful to display a scroll bar related to the size of the table and the row viewed at the moment, or any simple [begin---youAreHere---end] representation of the table.
Combine the prev & next queries to work out where you are. $pages_before = select count(primary_key) from table where primary_key < $current_id; $pages_after = select count(primary_key) from table where primary_key > $current_id; Of course it will be an approximation only because as you are editing record #X someone else could be deleting records a,b,c... -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#45444) next »