New some help.. I am new to php and can't get this one figured out.
I am currently try to create an admin page that will allow the admin to only see only there users by using the group field in mysql. So what I would like to see is if I am logged in it will pull my group by using the current users group from mysql database and insert it into the where statment. Is this possible? This is what I have so far ::
function displayUsers(){
global $database;
$q = "SELECT username,userlevel,email,group"
."FROM ".TBL_USERS." WHERE user= '$group'";
$result = $database->query($q);
/ Error occurred, return given name by default /
$num_rows = mysql_numrows($result);
if(!$result || ($num_rows < 0)){
echo "Error displaying info";
return;
}
database
username,userlevel,email, group
joe,1,joe@anywhere.com,1