check duplicated data from selected data
<p>Hello i'm going to check duplicated data from selected data but my code is not working properly </p>

<p>the my code is:</p>

<pre><code>$cs="0";
$location=array();
$check=array(); $check[0]="";
while ($db_field = mysql_fetch_array($result)) {    
     for ($z=0; $z&lt;=$cs;$z++){
        if($check[$z]==$db_field['location']) { 
          //*in here going to check same or not
        } 
        else {                            
          //*if not same $location_c[$cs] will get
          $location_c[$cs]= $db_field['location'];
          $check[$cs]= $db_field['location'];
        }
    }
    $cs++;
} 
</code></pre>

<p>this code prints all data not checking duplicated data.</p>
