title: mysqli : mysqli_result could not be converted to string
body: <p>I know there have been asked lots of similair questions like this one, but I just can't translate it to my problem so thats why I ask again. The code used to work fine but since the mysql is going to be deprecated I wanted to translate to mysqli.  </p>
  
  <p>I receive the following error when trying to read something from database: Catchable fatal error: Object of class mysqli_result could not be converted to string. It refers to line 12, which is </p>
  
  <pre><code> echo $result;
  </code></pre>
  
  <p>FULL CODE:</p>
  
  <pre><code>$previd ="10";
  $query="SELECT * FROM contacts WHERE id='$previd'";
  $result = $mysqli-&gt;query($query);
  
  echo $result;
  
  
  $num=$result-&gt;num_rows;
  
  $mysqli-&gt;close();
  
  echo "&lt;b&gt;&lt;center&gt;Database Output&lt;/center&gt;&lt;/b&gt;&lt;br&gt;&lt;br&gt;";
  
  $i=0;
  while ($i &lt; $num) {
  $id=mysql_result($result,$i,"id");
  $first=mysql_result($result,$i,"first");
  $last=mysql_result($result,$i,"last");
  $phone=mysql_result($result,$i,"phone");
  $mobile=mysql_result($result,$i,"mobile");
  $fax=mysql_result($result,$i,"fax");
  $email=mysql_result($result,$i,"email");
  $web=mysql_result($result,$i,"web");
  $content=mysql_result($result,$i,"content");
  
  echo "&lt;u&gt;$id&lt;/u&gt;&lt;b&gt;$first $last&lt;/b&gt;&lt;br&gt;Phone: $phone&lt;br&gt;Mobile: $mobile&lt;br&gt;Fax:     $fax&lt;br&gt;E-mail: $email&lt;br&gt;Web: $web&lt;br&gt;&lt;hr&gt;&lt;br&gt;$content";
  
  $i++;
   }
  </code></pre>
  
  <p>How can I solve this?</p>