title: Error: mysqli_fetch_object() expects parameter 1 to be mysqli_result
body: <p>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: </p>
  
  <blockquote>
    <p>mysqli_fetch_object() expects parameter 1 to be mysqli_result</p>
  </blockquote>
  
  <p>Here is my PHP code:</p>
  
  <pre><code>&lt;?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-&gt;title."'";
      $resultt = mysqli_query($link, $queryt);
      $rowt = mysqli_fetch_object($resultt);
      $title = $rowt-&gt;name;
  
          $sorgu = "select * from pub_author where user_id='$userid'";
          $publications = mysqli_query($link, $sorgu);
  
          while($a = mysqli_fetch_object($publications))
      {
         $ids .= $a-&gt;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-&gt;year);
            $accyaz[$mount[0]] = $a2-&gt;total;
        }
    }
  </code></pre>
  
  <p>?></p>