Load 2 tables mysql
#1

Hello, im using mysql to register/login account stats. Currently i have the table "players" which saves kills, score, money etc. etc. and each player has their unique account id (store in the table as well).

Since i don't like disorganized things, i created another table called "jobstats" which saves different job stats.

My question is:

Is possible to load jobstats table by using account id from players table to show job stats?

Currently i have this:

pawn Код:
mysql_format(g_SQL, query, sizeof query, "SELECT * FROM `players` WHERE `username` = '%e' LIMIT 1", Player[playerid][Name]);
How i can make server select the jobstats table based on the account id of the player?
Reply
#2

Keyword: forgein keys
Reply
#3

https://www.w3schools.com/sql/sql_foreignkey.asp

Got it. But how to use it?
Reply
#4

http://www.mysqltutorial.org/mysql-join/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)