MySQL vehicle ID problem.
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
That's normal. Auto-generated ID's do not get reset or reused. And with reason. For example, this very topic has id 634613 in the database. If it gets deleted then that ID does not get re-used. If it did get reused then all existing links to it would suddenly point to another topic. If you want to start from scratch you should use TRUNCATE TABLE. This deletes all the data and it also resets the auto-increment id. However I don't believe truncate will work if there are foreign keys.



Why? That's extremely counter intuitive. You already have the data so why (again) do you need to query for it?

Also what's the deal with prefixing variables with "i"? When I see "i" in front of a variable I think "integer". This makes your code a bitch to read because none of those variables are integers.
Just a small point, you can reset the ID's via
pawn Код:
ALTER TABLE DROP `somecolumname`
ALTER TABLE `sometable` ADD `id` INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`);
I don't recommend doing this. I was merely posting on how to reset it. You should never ever need, or use this method if your mode relies on ID's (stats, achievements etc). It can cause issues where the right data isn't being selected for a certain ID
Reply


Messages In This Thread
MySQL vehicle ID problem. - by Bwandon - 22.05.2017, 15:19
Re: MySQL vehicle ID problem. - by Vince - 22.05.2017, 15:28
Re: MySQL vehicle ID problem. - by Bwandon - 22.05.2017, 15:33
Re: MySQL vehicle ID problem. - by DobbysGamertag - 22.05.2017, 17:42

Forum Jump:


Users browsing this thread: 1 Guest(s)