title: Distinct in select query of mysql is not working
body: <p>I am using  <strong>distinct</strong> in select query of <strong>mysql database</strong> like this </p>
  
  <pre><code>$query=mysql_real_escape_string($_GET['query']);
  $query_for_result=mysql_query("SELECT DISTINCT *
  FROM vendor
  LEFT JOIN branches ON branches.vendor_id = vendor.vendor_id
  WHERE
  (vendor.name LIKE '%".$query."%'
  OR vendor.description LIKE '%".$query."%'
  OR branches.city LIKE '%".$query."%')");
  $qrow=mysql_fetch_array($query_for_result);
  if(empty($qrow)){
     while($qrow=mysql_fetch_array($query_for_result)){
  
            Some Code to display result 
  &lt;?php
     }
      mysql_close();
  }
      ?&gt;
  </code></pre>
  
  <p>Problem is this, it display every result many time , It display every result as many as it fond city from branches table , (Means: if a result in vendor table has 5 cities in branches table it will display 5 time)</p>