PDA

View Full Version : MySql Query usergroups


CoolHand_79
06-01-2006, 10:51 PM
How would I write a MySql query so that it will gather users of a usergroup and print them out on a page?

I want to make a custom pre-written members page.

Thanks,

Luke

xXSesshomaruXx
06-04-2006, 04:10 AM
sorry for the late reply, but



<?
$host = localhost;
$user = your_user;
$dbp = your_pass;
$db = your_db;

mysql_connect("$host", "$user", "$dbp");
mysql_select_db ("$db");

$result = mysql_query("SELECT * FROM "._TABLE_PREFIX_."user WHERE usergroupid=1");

while($i = mysql_fetch_array($result)) {
echo $i['username']."<br>\n";
}
?>


Someone may have found an easier way, but this does indeed work...

CoolHand_79
06-10-2006, 06:51 PM
w00t! Thanks!

Luke