How to get the id that came BEFORE the provided id
Posted on 2013-01-08
I have some code that supplies an $id and an $account_id for a record in a table
I need to be able to query using those what the PREVIOUS id is that is associated with that account_id.
So in other words, what was the last id for a record that was created before the one that is provided under that account _id.
Its not simply one less than the current id (LIMIT 1, 1) because there may be others in between that are associated to other accounts.
Make any sense?