I'm trying to simply display some data from my database, but without duplicates, I'm working with the following code:
$query = mysql_query("SELECT answers FROM users");
$rows = mysql_num_rows($query);
for ($j = 0 ; $j <= $rows ; ++$j)
{
$row = mysql_fetch_row($result);
echo $row[0]."<br>";
}
This works perfectly for just displaying the information from my database. but when trying to only display unique values, it isn't working...
I've tried:
$query = array_unique($query);
and
$row = array_unique($row);
and several others, yet nothing is working. :confused:
Please let me know of a solution if you know of one, thanks!