SA-MP Forums Archive
mysql id - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql id (/showthread.php?tid=343702)



mysql id - Dan. - 18.05.2012

The ID of the first car in MYSQL table should be 1.. the second car's ID should be 2 in mysql and so on and on.. how to do this?


Re: mysql id - AndreT - 18.05.2012

Using MySQL's AUTO_INCREMENT.

Also, I don't recommend relying on the database vehicle IDs very much because you might want to delete some vehicles from the database at one point and so on. In such cases, an empty ID will be left, so the IDs can go like 1 - 2 - 4, or similar.

Store the vehicle's database ID in an array instead.


Re: mysql id - Dan. - 18.05.2012

How should I do that? Not familiar with mySQL.


Re: mysql id - ProjectGANTON - 18.05.2012

I don't understand. You want to make that: The first car created, is id 0, the second 2 etc..?
So like players?