title: MySQLi Catchable Fatal Error
body: <p>I'm using prepared statements and MySQLi, and am currently getting this error.</p>
  
  <pre><code>PHP Catchable fatal error:  Object of class mysqli_stmt could not be converted to string in /Users/me/path/to/project/ModelBase/City.php on line 31
  </code></pre>
  
  <p>The code it's coming from (full function):</p>
  
  <pre><code>    function select($query, $limit)
  {
      $query = "%".$query."%";
      $con = ModelBase::getConnection();
      $sql = "SELECT name FROM cities WHERE name LIKE ? LIMIT ?";
      $query = $con-&gt;prepare($sql) or die("Error preparing sql in City ".parent::$db_conn-&gt;error);
      $query-&gt;bind_param("si", $query, $limit) or die("Error binding params in City ".parent::$db_conn-&gt;error);
      $query-&gt;execute() or die("Error executing query in City");
  
      $tmp = "";
      $res = $query-&gt;bind_result($tmp);
      while($query-&gt;fetch());
      {
          $citylist[] = $tmp;
      }
      $query-&gt;close();
  }
  </code></pre>
  
  <p>Like 31 is the $query->execute(). I can't find any information about this, and this is almost identical syntax to other systems I've built and never had this issue.</p>