Originally posted by paulnaj
Hi Mike,
Yeah ... I went through this sort of thing as well. In the end, the best thing is to just forget about using the pk as a 'row' number.
All you have to do is just create a SELECT statement that extracts the data in exactly the order you want! To get the 'row' #, merely increment an integer on each pass of the while loop (that calls mysql_fetch_array or whatever), and use that.
Hope that helps.
Paul π
PS. Auto-incrementing an integer guarantees uniqueness and is, er ... automatic, so great for pk's. Not so good for anything else π
Ok maybe I am a noob...what is a "pk"? I don't have problem extracting data in the order I want, or even working with the data when I do modify delete update or what not. I do have a counter that auto increments, that helps me label the numbers in the table when I list everthing.
When rows are deleted and added, it still works because my php script will use the row # passed to it to remove it.
So if I remove the "num" in my structure, I can still be able to remove and add them in my script? This is what my table looks like(disregard the junk data in it)

This is a screen shot of the table structure, with the missing 'num'. I wish I can at least make it use #'s that have gone away...But if not, when I do update/delete/etc, do I just be very selective? the other tuples are not guaranteed to be unique.
Mike