15.07.2014, 10:54
This is NOT the way to load stuff, that's incredibly inefficient. Get rid of the "where idbiz=" part and load the resultset at once. What do you think the "row" variable is for?
This is also NOT what an auto_increment is for. AI solely exists to uniquely identify each row. You should add a variable to your biz enum to store the SQL id. Then use that variable to update the corresponding row.
So it could end up like this:
Now if I want to update biz 3, I grab the variable and see that it corresponds with SQL id 5. I use that number to update the corresponding row.
This is also NOT what an auto_increment is for. AI solely exists to uniquely identify each row. You should add a variable to your biz enum to store the SQL id. Then use that variable to update the corresponding row.
So it could end up like this:
Код:
Internal ID | SQL auto_increment 0|1 1|2 2|4 3|5 4|7 5|8