You are right. "read previous" simply not exist. I think this is due to both 
historical reason and 'client/server model'.

In fact, 'read next' is available by reading next row in a query. However, 
the record cursor is one direction only and cannot be read back.

In my experience, I will store the row id of the previous record and perform 
another sql query if a back operation is required.

Regards, 

> Hi,
> Newbie here so please bear with me.
> I am running  MySQL 3.23.22 with PHP4.01 on WinNT client / Linux 
> host, everything is working okay and I'm just getting to grips with 
> some basic database handling. Although I can use mysql_query to get 
> a list of records using "Select * from `mydata`" - for what we are 
> looknig at, we also need a basic Next/Prev stepping capability on a 
> record per record basis. I realise this can be done just grabbing 
> all records and then moving through the rows, but we are also 
> looknig at picking up each record individually. I have had some 
> success using "count(*)" to get the last record, then stepping 
> through with "limit $x,1" in the select, where $x is decremented / 
> incremented based on which button is pressed. I cannot seem to find 
> any simply "read next" or "read previous" type command though. Is 
> the way I am going about it "right" or is there a more 
> simple/logical method? My main concern is that, with the key being 
> auto-increment, as records are added and removed from the database,
>  as simple +1/-1 may fall over. -Colin
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <mysql-unsubscribe-
[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


--
Yours,
KH Chiu
C&A Computer Consultants Ltd.
Tel: 3104 2070 Fax: 3010 0896
Email: [EMAIL PROTECTED]
Website: www.caconsultant.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to