Hello,
I am trying to get the results of a query and place them in a loop to populate a pull down. My code is below. It is working....however, it is displaying two of each result. I thought that using GROUP BY would eliminate any repeats.
What could I be doing wrong?
<?
$query="SELECT account_title from clients GROUP BY account_title";
$result=mysql_query($query) or die (mysql_error());
$num=mysql_numrows($result);
if(mysql_numrows($result) == '0') {
echo "Sorry, no results were found...";
} else {
// display results here
}
while ($row = mysql_fetch_array($result)) // this will grab the results from query
{
$listcat .= "<option value=\"$row[account_title]\">$row[account_title]</option>";
}
?>