MySQL numbering per player
#1

I am trying to create a vehicle system. And i want player to be able to have more than 1 car.
My question: is it possible to make auto numeration for every player? That there would be 1,2,3 for everyone. Because increment just numbers for everyone.
Hope you understood
Reply
#2

Create a table for vehicles if you haven't already. Create a combined primary key, consisting of the userid that's in your player's table (use foreign keys) and the auto_increment vehicleid from the vehicle's table. Then your table could look something like:

useridvehicleidmodel
11522
12402
23600
Reply
#3

Okay...i thought i understand,but i don't. How do i create a combined primary key?

EDIT. How do i create a foreign key? Once again i think i understood how to do else.
Reply
#4

bump
Reply
#5

How do i set a foreign key on already existing tables?
Reply
#6

Easiest way would be with pma - add index key, then switch to relative view and add foreign key
Reply
#7

could you eplain it slower ?
Reply
#8

phpMyAdmin - if you are working on your computer, I can assume that you are running WAMP/XAMPP or something like this so it should be included by default. Also almost every webhosting has it
Reply
#9

I use webhosting. What is relative view?
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)