Hello, I am trying to make a page where an admin can edit a part of a user. I want the page to first display a list of a certain type of users. So first I just use a while loop:
include "config.php";
// connect to the mysql server
$link = mysql_connect($server, $db_user2, $db_pass2)
or die ("Could not connect to mysql because ".mysql_error());
// select the database
mysql_select_db($database2)
or die ("Could not select database because ".mysql_error());
//If cmd has not been initialized
if(!isset($cmd))
{
//display all the links
$result = mysql_query("SELECT * FROM smf_members order by ID_GROUP desc");
//run the while loop
while($r=mysql_fetch_array($result))
{
//grab the title and the ID
$name=$r["MemberClanName"];//take out the title
$id=$r["ID_MEMBER"];//take out the id
//make the title a link
echo "<a href='rpoints.php?cmd=edit&ID_MEMBER=$id'>$name</a>";
echo "<br>";
}
}
But I would like it to filter through those results so it only shows users that are in certain groups. I want it to check a row called "ID_GROUPS" and see if the number is a 9 or a 1 and if so display only those, but get rid of the rest.
Is this possible to do, and if so how would I accomplish it?