Home » Php » PHP MySQL Query to implement an Alphabetic "Next Record"

PHP MySQL Query to implement an Alphabetic "Next Record"

Posted by: admin February 25, 2020 Leave a comment

Questions:

In my PHP Address Book program, when I click on the “Next” record button,
it jumps to the next higher “ID” number.
What MySQL Query would it take to jump to the next Alphabetic sequence?
In other words, to proceed by Last Name in Aphabetic order.
Albert ->Baker->Carbott->Dobson…

The following creates an Alphabetic result by Last Name:
SELECT * FROM address_table ORDER BY last_name
(Thank you entoniperez.)

However, when you are looking at one of the records,
What MySQL Query would it take to jump to the next Alphabetic sequence?

How to&Answers:

Simply, run your query like this:

SELECT * FROM address_table ORDER BY last_name