Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
This statement gets a set of records in the database in date order it then updates a column called TKT_order placing a number in increments of 1 in each row returned. so row 1 would have an order of "1", row 2 would have "2", row 3 "3" etc etc. using a @variable is the only efficient way I know of doing it without lopping through all the records in php and running an mysql update for each one...