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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux