14.09.2012, 08:03
Playerid (foreign key) is used in every other table because it's a normalized database (http://en.wikipedia.org/wiki/Database_normalization). If you want to get the username and the message in the same query you have to do a SQL Join, like this (didn't tried it). :
---
Thanks for the comments.
Код:
SELECT u.username AS username, c.chatmsg AS message FROM rstats_chatmessages INNER JOIN rstats_users u ON u.userid = c.playerid WHERE u.username = 1;
Thanks for the comments.



