chrjoh88
12-02-2010, 11:58 AM
Hi everyone i have this code,
What i want instead is to use in sed_users a sql table i made for testing at this moment called class in there i have names like
#paladin
#warrior
#shaman
#etc
But im quite new at mysql part and php for that matter but i almost got a finnished product that im happy with this will be one of the main core funcions in my site.
I've got a few hints how to do this but my results is always failing.
$result = "users #".$id; <= to .$class ?
$sql ....("SELECT class?? FROM sed_users WHERE class='".$class."' REMOVE => LIMIT 1 <= REMOVE? ");
$css_group[shaman] this would be the output of what names in class?
$css_group[paladin]
$result = "<a class=\"armory_tip armory_tt_class_".$css_group[$row['class']]."\"
Somthing like that right? in therory im up with this idé, but practical i just fail over and over every time. :confused:
Thanks in advance, every hint of tips would just be a life saver.
Chris.
function sed_build_user($id, $user) {
if ($id==0 && !empty($user)) { $result = $user; }
elseif ($id>0 && empty($user)) { $result = "User #".$id; }
else {
$sql = sed_sql_query("SELECT gru_groupid FROM sed_groups_users WHERE gru_userid='".$id."' LIMIT 1");
$row = sed_sql_fetchassoc($sql);
$css_group[1] = "guests";
$css_group[2] = "inactive";
$css_group[3] = "banned";
$css_group[4] = "Warlock";
$css_group[5] = "Paladin";
$css_group[6] = "moderators";
$result = "<a class=\"armory_tip armory_tt_class_".$css_group[$row['gru_groupid']]."\" href=\"users.php?m=details&id=".$id."\">".$user."</a>";
}
return($result);
}
What i want instead is to use in sed_users a sql table i made for testing at this moment called class in there i have names like
#paladin
#warrior
#shaman
#etc
But im quite new at mysql part and php for that matter but i almost got a finnished product that im happy with this will be one of the main core funcions in my site.
I've got a few hints how to do this but my results is always failing.
$result = "users #".$id; <= to .$class ?
$sql ....("SELECT class?? FROM sed_users WHERE class='".$class."' REMOVE => LIMIT 1 <= REMOVE? ");
$css_group[shaman] this would be the output of what names in class?
$css_group[paladin]
$result = "<a class=\"armory_tip armory_tt_class_".$css_group[$row['class']]."\"
Somthing like that right? in therory im up with this idé, but practical i just fail over and over every time. :confused:
Thanks in advance, every hint of tips would just be a life saver.
Chris.
function sed_build_user($id, $user) {
if ($id==0 && !empty($user)) { $result = $user; }
elseif ($id>0 && empty($user)) { $result = "User #".$id; }
else {
$sql = sed_sql_query("SELECT gru_groupid FROM sed_groups_users WHERE gru_userid='".$id."' LIMIT 1");
$row = sed_sql_fetchassoc($sql);
$css_group[1] = "guests";
$css_group[2] = "inactive";
$css_group[3] = "banned";
$css_group[4] = "Warlock";
$css_group[5] = "Paladin";
$css_group[6] = "moderators";
$result = "<a class=\"armory_tip armory_tt_class_".$css_group[$row['gru_groupid']]."\" href=\"users.php?m=details&id=".$id."\">".$user."</a>";
}
return($result);
}