I am having a few problems trying to create a unique array so far i have the following:
function getUsers()
{
global $link;
$result = mysql_query("SELECT usr_login FROM users, entries WHERE usr_login = ent_user ORDER BY usr_login", $link);
return $result;
}
for example this would return "Twigg","Bex","Monkey","Monkey","Twigg","Bex" in the usr_login field..
print "Select the person whos entries you wish to view:<BR>";
$result = getUsers();
while($user = mysql_fetch_array($result))
{
print $user[usr_login]."<BR>";
}
The above works fine accept it returns duplicates in the user list (obviously!).. i have tried the following and many other different things, but to no avail!
print "Select the person whos entries you wish to view:<BR>";
$result = getUsers();
$array = array_unique(mysql_fetch_array($result));
foreach($array as $user)
{
print $user[usr_login]."<BR>";
}
Any help would be excelent!
Cheers