title: in array skip the values from mysql database
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8571902/mysql-select-only-unique-values-from-a-column">MySQL: Select only unique values from a column</a>  </p>
  </blockquote>
  
  
  
  <p>iam getting values from mysql table category and column parent.
  Parent contain values like 1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4</p>
  
  <p>I want to skip the values if they are repeating. So i want the output as 1,2,3,4</p>
  
  <p>Please help me..my code is not woking.</p>
  
  <pre><code>$new_cat1 = $cat1;
      foreach($cat1 as $category){
          $query="SELECT parent FROM categories where id='$category'";
          $result = mysql_query($query);  
          $line = mysql_fetch_assoc($result);
          array_push($new_cat1,$line['parent']);
          if (in_array("1", $new_cat1)) {
          continue;
          }
      }
  </code></pre>