Clarification: Jump to a record/PHP paging...



I see now that I did not explain myself adequately.
I think "jump to record" was the wrong way to put it. So, here goes.

I already have excellent paging functionality working well, based on a nice tutorial at PHPFreaks.

My problem is that when a user performs a search, I need to display the page on which their search string is found, but still display ALL records within the paging of the entire database.
I've since discovered the core of what I need to do:

1. I can find the record I need through a simple query.

2. I can easily determine WHICH page this record is on by counting BACKWARDS from the found record to the FIRST record, totaling the number of records from record 1 to the found record. Then, by performing a bit of division, I can determine which page that record appears on and direct the user to "...page=8" via $_GET.

SO, my question is: how might I have MySQL tell me how many records came BEFORE the found record?
(FYI: there is currently no auto-incrementing ID on these records, so that obviously easy solution would be unavailable.)

Thanks in advance for any insight.

--
T.J. Mahaffey
tj@xxxxxxxxxxxxxx
.



Relevant Pages

  • Re: [PHP] Clarification: Jump to a record/PHP paging...
    ... I already have excellent paging functionality working well, based on a nice tutorial at PHPFreaks. ... My problem is that when a user performs a search, I need to display the page on which their search string is found, but still display ALL records within the paging of the entire database. ... But those searches come back with correct searches and then sort them in terms of relevance. ... You could put in a field that has a number assigned to it, and show what numbers came before and after the record selected (like sequence of entry, auto-incrementing ID), but that isn't relevant to the original search criteria. ...
    (php.general)
  • Re: RichL (or any other beatles fans)
    ... Squier wrote: ... and if you can read or display the last 26,000 articles ... then you can download the picture series named "ImagesOfTheBeatles" ... (if you do a search using "ImagesOfTheBeatles" as the search string ...
    (alt.guitar)
  • Re: [PHP] Clarification: Jump to a record/PHP paging...
    ... T.J. Mahaffey wrote: ... > page on which their search string is found, but still display ALL ... first time u get the search results and the second time u get all the results. ...
    (php.general)
  • Re: Newbie question passing query from a user control to aspx page
    ... Isn't it a security issue to put a search string on a URL? ... additional parameters and a datagrid to display results. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: OWA 2000 and GAL
    ... Tom typed: ... Names Dialog box or must one enter a search string and click "Find ... search fields (Display Name, First Name, Last Name, etc). ... am looking for sort of. ...
    (microsoft.public.exchange.admin)