hi, i am trying to make a page that displays my players discoveries within my game.
I need to display either 'Undiscovered' or the 'Discovery Name' .
Currently i do a query for each trait, example..
$traits = SELECT COUNT(*) as `count` FROM `discoveries` WHERE `discovery_name`='Trait1';
if ($traits->count > 0)
$trait1 = 'Trait 1';
else
$trait1 = 'Undiscovered';
$tpl->assign(trait1, $trait1);
Im sure there must be an easier and more dynamic way to do this..
I have 2 tables in a MySQL database.
table discoveries
player, discovery_name
table traits
id, trait_name, type
i need to check if the discovery_name exists in the discoveries table for each 1 of the trait_names in the traits table
Thanks