SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member edpudol's Avatar
    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

  2. #2
    Team SitePoint Lucas Chan's Avatar
    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

  3. #3
    SitePoint Member edpudol's Avatar
    Join Date
    Oct 2004
    Location
    philippines
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks.. i think this helps..

  4. #4
    $this->toCD-R(LP); vinyl-junkie's Avatar
    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
    This will either return records starting at record 11 (that's 10 plus 1, since SQL starts numbering from 0), or will return no records.

    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

  5. #5
    SitePoint Member edpudol's Avatar
    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?

  6. #6
    $this->toCD-R(LP); vinyl-junkie's Avatar
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •