Your
id column is the primary key, and should
NOT change for a given row.
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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.