List:General Discussion« Previous MessageNext Message »
From:Jerry Date:February 19 2003 3:01pm
Subject:Re: Sequential read on a file
View as plain text  
Use and id column, like an auto increment one and use that in the html you
are writing out +1 or -1 to get the next.

i.e.

"select id, X, X, X from table where id=1"

returns 1, value of X, value of X, value of X etc etc etc

then in the html use the id .
id+1
<a href="wizzyScript.php?id=2">Next</a>

need some error checking for less than 0 and finding out what the max is.

Most lightly going to be something in here :

http://www.devshed.com/Server_Side/PHP


Is it a case of one rows worth of information from the dB per page/request ?

----------
Jerry @
MetalCat
dot Net
----------

----- Original Message -----
From: "Colin" <Colin@stripped>
To: <mysql@stripped>
Sent: Wednesday, February 19, 2003 2:51 PM
Subject: Sequential read on a file


> 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 <mysql-thread132820@stripped>
> To unsubscribe, e-mail
<mysql-unsubscribe-jerry=metalcat.net@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>

Thread
Sequential read on a fileColin19 Feb
  • Re: Sequential read on a fileJerry19 Feb
  • Re: Sequential read on a fileKH Chiu19 Feb
RE: Sequential read on a fileColin19 Feb