title: Mysqli connection issue fatal error
body: <p>I have the below code:</p>
  
  <pre><code>class config_model
  {
      public $host;
      public $root;
      public $root_password;
      public $db;
  
      public function __construct() {
          $this-&gt;host = "localhost";
          $this-&gt;root = "root";
          $this-&gt;root_password = "";
          $this-&gt;db = "Data";
      }
  
      public function init() {
          $mysqli = new mysqli($this-&gt;host, $this-&gt;root, $this-&gt;root_password, $this-&gt;db);
          if ($mysqli-&gt;connect_error) {
              die('Connect Error (' . $mysqli-&gt;connect_errno . ') '
                  . $mysqli-&gt;connect_error);
          }
          return $mysqli;
      }
  }
  
  $config_model = new config_model();
  echo $config_model-&gt;init();
  </code></pre>
  
  <p>When I check the script I see this error: </p>
  
  <blockquote>
    <p>"Catchable fatal error: Object of class mysqli could not be converted to string".</p>
  </blockquote>
  
  <p>The erorr is here: "<strong>echo $config_model->init();</strong>"</p>
  
  <p>How do I handle this error?</p>