consecutive rows
Moderator: General Moderators
consecutive rows
i have many of rows in a table.. all of them have a number identifyer thats auto incremented. Im trying to make a script that each time the script is called it selects one row then pulls the info from it.. then the next time its called, it pulls the next row and moves on down the list in order. So it'll rotate through each of the rows in the table. The problem is that the id number isnt consecutive because some rows have been removed. I created a table that the script will store the last row accessed and then the next time its called it can move on. Whats the best way to add 1 to the last row called.. check to see if it exsists, if not add 1 more to that number check to see if its there.. if so call the information and move on with the rest of the script?
in addition to feyd's post
you won't be adding 1 to the last row called
you'll be selecting the next record where id > that record
using limit 1, like suggested above
you won't be adding 1 to the last row called
you'll be selecting the next record where id > that record
using limit 1, like suggested above
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.