SQL -> Vehicle saving
#7

Quote:
Originally Posted by bogushas
Посмотреть сообщение
So what should I instead playername?
Every player should have a unique ID in the database.
An ID is just an integer variable, usually that column is set to auto_increment and Primary Key.
Integers are alot faster to search for compared to a string.

For owned vehicles, you should store the player's ID as set in MySQL.

You would get in trouble if you allow a /changename command, which would allow the player to change his name.
Then you would not only need to update his name in your playerdata table, but in the owned vehicles table as well.

When you use his ID, you can change his name all the time, as everything is connected to his ID, which never changes.
Reply


Messages In This Thread
SQL -> Vehicle saving - by bogushas - 13.12.2014, 08:09
Re: SQL -> Vehicle saving - by bogushas - 13.12.2014, 10:41
Re: SQL -> Vehicle saving - by Vince - 13.12.2014, 10:55
Re: SQL -> Vehicle saving - by bogushas - 13.12.2014, 13:24
Re: SQL -> Vehicle saving - by bogushas - 13.12.2014, 13:56
Re: SQL -> Vehicle saving - by Kaperstone - 13.12.2014, 14:30
Re: SQL -> Vehicle saving - by PowerPC603 - 13.12.2014, 14:41
Re: SQL -> Vehicle saving - by bogushas - 13.12.2014, 15:26

Forum Jump:


Users browsing this thread: 1 Guest(s)