Next and Previous MySQL row based on name

Posted by NightMICU on Stack Overflow See other posts from Stack Overflow or by NightMICU
Published on 2010-06-17T01:28:34Z Indexed on 2010/06/17 1:32 UTC
Read the original article Hit count: 260

Filed under:
|
|
|

Hi everyone,

I have a table with details on personnel. I would like to create a Next/Previous link based on the individual's last name. Since personnel were not added in alphabetical order, selecting the next or previous row based on its ID does not work.

It is a hefty table - the pertinent fields are id, name_l, and name_f. I would like to order by name_l, the individuals' last name.

How would I go about accomplishing this task?

Thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql