View Single Post
Old 10-09-2007, 11:57 AM   #21 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Create a vocations table with columns such as id, name, description which you can add rows for each of the available vocations. You can then search the players table for players by vocation name by JOINing the vocations table.

Code:
-- Example query to fetch players who are 'knights'
SELECT p.* 
FROM players p
LEFT JOIN vocation v ON v.id = p.vocation
WHERE v.name = 'knight'
Salathe is offline  
Reply With Quote