Jalrock
12-03-2002, 09:36 PM
Can this be reduced into a single query? if so how do I call each attribute?
$memhealth=$DB_site->query_first("SELECT battle_health FROM user WHERE userid='$bbuserinfo[userid]'");
$battle_health=$memhealth[battle_health];
$memintel=$DB_site->query_first("SELECT battle_intel FROM user WHERE userid='$bbuserinfo[userid]'");
$battle_intel=$memintel[battle_intel];
$memmagic=$DB_site->query_first("SELECT battle_magic FROM user WHERE userid='$bbuserinfo[userid]'");
$battle_magic=$memmagic[battle_magic];
$memskill=$DB_site->query_first("SELECT battle_skill FROM user WHERE userid='$bbuserinfo[userid]'");
$battle_skill=$memskill[battle_skill];
$memarmor=$DB_site->query_first("SELECT battle_armor FROM user WHERE userid='$bbuserinfo[userid]'");
$battle_armor=$memarmor[battle_armor];
$DB_site->free_result($memhealth);
$DB_site->free_result($memintel);
$DB_site->free_result($memmagic);
$DB_site->free_result($memskill);
$DB_site->free_result($memarmor);
eval("\$battle_mem_stats = \"".gettemplate('battle_mem_stats')."\";");
I think this is the first part????
$membattlestats=$DB_site->query_first("SELECT battle_armor, battle_intel, battle_magic, battle_skill, battle_armor FROM user WHERE userid='$bbuserinfo[userid]'");
but I dont know how the rest is done?
Any help greatly appreciated.
$memhealth=$DB_site->query_first("SELECT battle_health FROM user WHERE userid='$bbuserinfo[userid]'");
$battle_health=$memhealth[battle_health];
$memintel=$DB_site->query_first("SELECT battle_intel FROM user WHERE userid='$bbuserinfo[userid]'");
$battle_intel=$memintel[battle_intel];
$memmagic=$DB_site->query_first("SELECT battle_magic FROM user WHERE userid='$bbuserinfo[userid]'");
$battle_magic=$memmagic[battle_magic];
$memskill=$DB_site->query_first("SELECT battle_skill FROM user WHERE userid='$bbuserinfo[userid]'");
$battle_skill=$memskill[battle_skill];
$memarmor=$DB_site->query_first("SELECT battle_armor FROM user WHERE userid='$bbuserinfo[userid]'");
$battle_armor=$memarmor[battle_armor];
$DB_site->free_result($memhealth);
$DB_site->free_result($memintel);
$DB_site->free_result($memmagic);
$DB_site->free_result($memskill);
$DB_site->free_result($memarmor);
eval("\$battle_mem_stats = \"".gettemplate('battle_mem_stats')."\";");
I think this is the first part????
$membattlestats=$DB_site->query_first("SELECT battle_armor, battle_intel, battle_magic, battle_skill, battle_armor FROM user WHERE userid='$bbuserinfo[userid]'");
but I dont know how the rest is done?
Any help greatly appreciated.