I don't know what the problem is with this line or how to fix it, before was okay and now I'm getting this error:
mysqli_fetch_object() expects parameter 1 to be mysqli_result
Here is my PHP code:
<?php
}   
if($_GET['action']=="user_info")
    {
    $userid = $_GET['user_id'];
    $query = "SELECT * FROM user WHERE user_id ='{$userid}'";
    $result = mysqli_query($link, $query);
    $user = mysqli_fetch_object($result);
    $queryt = "SELECT * FROM user_title WHERE id='".$user->title."'";
    $resultt = mysqli_query($link, $queryt);
    $rowt = mysqli_fetch_object($resultt);
    $title = $rowt->name;
        $sorgu = "select * from pub_author where user_id='$userid'";
        $publications = mysqli_query($link, $sorgu);
        while($a = mysqli_fetch_object($publications))
    {
       $ids .= $a->pub_id . ',';
    }
       $ids = rtrim($ids,",");
   $sorgu2 = "select count(id) as total , year from publication where id IN ($ids)
       GROUP BY YEAR(`year`) order by `year` ";
   $publications2 = mysqli_query($link, $sorgu2);
       while($a2 = mysqli_fetch_object($publications2))
       {
          $mount = explode('-', $a2->year);
          $accyaz[$mount[0]] = $a2->total;
      }
  }
?>
 
     
     
     
    
}else{}, The problem is no data in db – Anand Somasekhar Apr 14 '14 at 12:26