SA-MP Forums Archive
mysql question - 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 question (/showthread.php?tid=607782)



mysql question - ilijap - 23.05.2016

OK I am working on mysql vehicle ownership system. And I want to add keys for players. Like I am the owner of the vehicle and I want to give you a key from my car and I can give as much keys as I want. Now I only have columns for position, owner, price and model. I want to ask is it possible to dynamicly add columns for keys for a car or is there another function to do this


Re: mysql question - Vince - 23.05.2016

You need an association table (supposedly called "CarKey") between player and car.



Underlined attributes are primary keys. FK is foreign key.


Re: mysql question - ilijap - 23.05.2016

Quote:
Originally Posted by Vince
Посмотреть сообщение
You need an association table (supposedly called "CarKey") between player and car.



Underlined attributes are primary keys. FK is foreign key.
This is what I understood from your comment:

Make another table keys add 2 columns. 1 for player and 1 for car id. And then just load it?