Can not fetch data randomly using PHP and MySQL
<p>I need one help.I am trying to fetch data randomly using PHP and MySQL but its not happening like that. I am explaining my code below.</p>

<pre><code>$day_id=$_GET['day_id'];
$sql=mysqli_query($connect,"select * from db_restaurant_basic where premium=1 and status=1 order by member_id,rand()");
if(mysqli_num_rows($sql) &gt; 0){
    while($row=mysqli_fetch_array($sql)){
          $member_id=$row['member_id'];
          $quad_id=$row['quadrant'];
           $sqlqry=mysqli_query($connect,"select * from  db_restaurant_detail where member_id='".$member_id."' and day_id='".$day_id."' and checked=1" );
          while($details=mysqli_fetch_array($sqlqry)){
                        $data[]=array("day_id"=&gt;$details['day_id'],"comment"=&gt;$details['comment'],"restaurant_name"=&gt;$row['rest_name'],"member_id"=&gt;$row['member_id'],"available_image"=&gt;$available_image,"city"=&gt;$row['city'],"proviance"=&gt;$row['proviance'],"postal_code"=&gt;$row['postal'],"country"=&gt;$row['country'],"person"=&gt;$row['person'],"mobile"=&gt;$row['mobile'],"url"=&gt;$row['url'],"premium"=&gt;$row['premium'],"image"=&gt;$row['image'],"business_phone_no"=&gt;$row['business_phone_no']);
          }
    }
}
$result=array("data"=&gt;$data,"imagepath"=&gt;$imagepath);
echo json_encode($result,JSON_UNESCAPED_SLASHES);
</code></pre>

<p>From the above query i can not get the random data.Please help me to resolve this issue. </p>