$query = "SELECT DISTINCT USER_NAME, ROLE FROM FOX_MASTER_ROLE_OF_USERS ORDER BY ROLE, USER_NAME";
$result = mysql_query($query) or die(mysql_error());
echo "<br />";
echo "<table>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td width=200>" . $row['USER_NAME']. "</td><td width=200>". $row['ROLE']. "</td width=200><td>". "<a href=javascript:confirmDelete('delete.php?id=$row[ID]')>[Delete]</a></td>" ;
echo "</tr>";
}
echo "</table>";
?>
I have the above, there are duplicates in the table so i use Distinct, But as in the table i have an ID coloum i cant select that while using distinct but i need it to pass it on as a variable to the $row[ID]
How can i do this?