SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: Record Navigating
-
Oct 21, 2004, 20:47 #1
- Join Date
- Oct 2004
- Location
- philippines
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Record Navigating
How could I navigate to mysql database Assuming I want to goto to specific record then from there display the next records...
like xbase... command:
Goto record 21
display next
-
Oct 21, 2004, 21:03 #2
- Join Date
- Sep 2002
- Location
- Melbourne
- Posts
- 59
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If I understand your question correctly, this page will be of some assistance:
http://au.php.net/manual/en/function...-data-seek.php
-
Oct 22, 2004, 04:25 #3
- Join Date
- Oct 2004
- Location
- philippines
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanks.. i think this helps..
-
Oct 22, 2004, 05:30 #4
- Join Date
- Dec 2003
- Location
- Federal Way, Washington (USA)
- Posts
- 1,524
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The way I do it is like this:
Code:SELECT * FROM table LIMIT 10,20
You must be careful with mysql_data_seek, because if you start with a non-existent record, you will get an error.
edited: Correction of record number retrieved using LIMIT clause. (I can't believe no one called me on that!)Last edited by vinyl-junkie; Oct 22, 2004 at 17:41.
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
Showcase your music collection on the Web
-
Oct 22, 2004, 23:14 #5
- Join Date
- Oct 2004
- Location
- philippines
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanks vinyl-junkie for being there patiently answering my questions...
in this regard I have a follow up question about navigation...
I use this code to search a record:
Select * from tbl WHERE username = '$username' LIMIT $startATuserposition, 20"
That is my problem the $startAtuserposition how could I determine the current row possition of the said recor?
-
Oct 22, 2004, 23:49 #6
- Join Date
- Dec 2003
- Location
- Federal Way, Washington (USA)
- Posts
- 1,524
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here's how I do it, only I have number of records per page stored in a variable, too. Hope it helps.
Code:$RowStart = ($PageCurrent - 1) * $PageSize + 1;
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
Showcase your music collection on the Web
Bookmarks