MyBB Community Forums

Full Version: Download additional information.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have a problem, get tired of it for some time. I have no idea how to do that downloaded data (shown below) also fetch the information, in which the group is the user (the one that is now online). My request:
$query = $db->query("
		SELECT s.sid, s.ip, s.uid, u.username, s.time, u.avatar, u.usergroup, u.displaygroup
		FROM ".TABLE_PREFIX."sessions s
		LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
		WHERE u.usergroup $gid AND time>'{$timesearch}'
		ORDER BY u.username ASC, s.time DESC
	");
Well, I tried can add:
LEFT JOIN ".TABLE_PREFIX."usergroups u ON (condition)
I found the code on the local forum. But I have no idea how to add a condition. I also tried to execute a new query that retrieves the required data (name, style), but I do not know quite how to connect with downloaded data from the previous query (to the selected user - his group).

Please bear with us, not yet reached the level of the developer.
Regards, Snake_.

Nobody is able to help me? Although some guides the, what I have to do ...

You can move the trash / close, or anything else Do. I told myself.
I know it can be make with one query.
Here is second query where you can get usergroups on show forum team.
	$query_options = array(
                "order_by" => "title",
                "order_dir" => "asc",
                "limit_start" => 0,
                "limit" => 15
        );
	$query2 = $db->simple_select("usergroups", "gid, title, description", "showforumteam=1", $query_options);