21.10.2015, 09:27
Quote:
|
Why don't you save all these things like a text and split them with sscanf on loading? Believe me, it's easier and the query will be shorter also.
http://forum.sa-mp.com/showthread.ph...98#post1087498 |
@OP, I think you've been told at least half a dozen (by me and others) that you should normalize your tables. If you need to add a number to a column name you are doing databases wrong.
Faction has Members and has Cargo. All words that I have underlined constitute different tables.
Very rudimentary you would have four tables that look like this. Columns that are underlined are part of that table's primary key.
Faction (existing table)

Player (existing table)

FactionMember (new table)

FactionCargo (new table)

FactionMember (and by extension FactionCargo) would then be filled as follows:

Or in more useful format:
PHP код:
SELECT f.name AS factionName, p.name AS playerName, FROM_UNIXTIME( joinedDate ) AS joinedDate, rank
FROM FactionMember fm
JOIN Player p ON p.id = fm.playerId
JOIN Faction f ON f.id = fm.factionId


