title: using array unique with array
body: <p>I have the php code as below:</p>
  
  <pre><code>&lt;?php
      $conn = mysql_connect("localhost","root","") or die(mysql_error());
      mysql_select_db("dbcsv",$conn);
      $data = array();
      $sql = "select orig,dlvSourceIp from tblcsv group by dlvSourceIp";
      $res = mysql_query($sql) or die(mysql_error());
       echo '&lt;table border="1px"&gt;';
       echo "&lt;tr&gt;&lt;td&gt;Dormain&lt;/td&gt;&lt;td&gt;ip of the domain&lt;/td&gt;&lt;td&gt;Total Mail&lt;/td&gt;&lt;td&gt;Mail Fail&lt;/td&gt;&lt;td&gt;Percentage&lt;/td&gt;&lt;/tr&gt;";
          while($data = mysql_fetch_array($res)){
               //echo "&lt;tr&gt;&lt;td&gt;".$data['orig']."&lt;/td&gt;&lt;td&gt;".$data['dlvSourceIp']."&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;";
              $t = $data['orig'];
               $getData = array_unique($t);
               var_dump($getData);
  }
  ?&gt;
  </code></pre>
  
  <p><strong>Note</strong></p>
  
  <p>For <code>$data['orig']</code> is the array of data that I select it from database it will display: <code>cat cat dog cat dog</code>. I want output like this:<code>cat dog</code> that why I use array unique.</p>
  
  <p><strong>The problem:</strong></p>
  
  <p>I got the error message <code>array_unique() expects parameter 1 to be array, null given in C:\wamp\www\CountLine_CSV\csv2mysql.php on line 21</code> How do I fix it? Anyone help me please,Thanks.</p>