title: About PHP connection object
body: <p>Could somebody explain to me why the following is wrong :</p>
  
  <pre><code>$sql='SELECT * FROM images';
  $hostname ='localhost';
  $username= 'root';
  $password= '';
  $db= 'myDB';
  
  $numRows=new mysqli($hostname, $username, $password, $db)-&gt;query($sql)-&gt; num_rows;
  </code></pre>
  
  <p>The error throws is : syntax error, unexpected T_OBJECT_OPERATOR .....</p>
  
  <p>and is it possible to correct it in one statement like above ? Thank you.</p>