in reply to mysql auto_incremented id
The value of this column should not have any significance beyond identifying the row - which means that the rest of your code should not rely on the fact that id # 25 is the 25th row. There are multiple reasons for this, the first and most important being that a relational database table is inherently unordered - you can only say that a particular row is the i-th row when using an ORDER BY clause (yes, I know that most database system will return data in a consistent order without an ORDER BY clause, but you should never rely on this fact).
It follows that the rest of your code should only treat the id value as an identifier, and use some other mechanism to count or keep track of the position of the row in the current result set.
Michael
|
|---|