title: DISTINCT keyword is not working when I using the PHP MySQL query
body: <p>When I using the PHP MySQL query DISTINCT keyword is not working
  here is my PHP query store data into JSON format</p>
  
  <pre><code>&lt;?php
  include("connection.php");
  $uid=$_REQUEST['userid'];
  $activityname="Change status";
  $recentstatus=mysqli_query($cn,"SELECT DISTINCT userstatus,activityid,userid FROM useractivity WHERE userid='$uid' AND activityname='$activityname' ORDER BY activityid DESC ");
  while($raw=mysqli_fetch_assoc($recentstatus))
  {
      $emparray[] = $raw;      
  }
  $x['data'][]=$emparray;
  $x['status']='OK';
  echo json_encode($emparray);  
  ?&gt;
  </code></pre>