Comparing the playerid to child table
#2

I wouldn't use a child table at all.

The main table for houses should have the primary key to its house ID so it can be able to update data whenever you want and have a column like "Owner" that is set to 0 if no owner or the user ID if it is owned.

EDIT: On second tought, this way is better.

When a player connects to the server and after logging, sending a query such (an example):
pawn Код:
"SELECT houseid FROM houses WHERE Owner=%i"
would select all the house IDs that player owns.

No need to have per-player variables. Have the Owner (user ID or 0) stored in a variable and then comparing would be really easy.
Reply


Messages In This Thread
Comparing the playerid to child table - by vernz - 09.05.2016, 19:40
Re: Comparing the playerid to child table - by Konstantinos - 09.05.2016, 20:01
Re: Comparing the playerid to child table - by Nin9r - 10.05.2016, 09:30

Forum Jump:


Users browsing this thread: 1 Guest(s)