Not Solved Database queries.
#4
Not Solved
here is a simple example php file to get user groups names & their IDs
<?php

define('IN_MYBB', 1);
require_once "./global.php";

// GET USERGROUPS
	$query = $db->simple_select("usergroups", "*", "");
	$sep = "";
	while($group = $db->fetch_array($query))
	{
		// GROUPNAME
		$groupname = $group['title'];
		// GID
		$gid = $group['gid'];
		$groups .= "{$sep} [ {$gid} ] &rarr; {$groupname}";
		// SEPERATOR
		$sep = "<br />";
	}

// OUTPUT
echo $groups;

see Database Methods guidance
Reply


Messages In This Thread
Database queries. - by Freakout14 - 2017-05-01, 10:52 AM
RE: Database queries. - by .m. - 2017-05-01, 11:06 AM
RE: Database queries. - by Freakout14 - 2017-05-01, 11:12 AM
RE: Database queries. - by .m. - 2017-05-01, 11:31 AM
RE: Database queries. - by Freakout14 - 2017-05-01, 11:34 AM
RE: Database queries. - by .m. - 2017-05-01, 11:53 AM
RE: Database queries. - by Freakout14 - 2017-05-01, 12:02 PM
RE: Database queries. - by .m. - 2017-05-01, 12:41 PM
RE: Database queries. - by Freakout14 - 2017-05-01, 03:41 PM
RE: Database queries. - by broatcast - 2017-05-01, 04:13 PM
RE: Database queries. - by Freakout14 - 2017-05-01, 04:14 PM
RE: Database queries. - by broatcast - 2017-05-01, 06:08 PM
RE: Database queries. - by Freakout14 - 2017-05-01, 09:54 PM
RE: Database queries. - by .m. - 2017-05-02, 12:15 AM
RE: Database queries. - by Freakout14 - 2017-05-02, 12:27 AM
RE: Database queries. - by .m. - 2017-05-02, 01:03 AM
RE: Database queries. - by Freakout14 - 2017-05-02, 01:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)