title: Can't we call $result as variable in php
body: <p>i have query in my php code</p>
  
  <pre><code>$dbc = mysqli_connect('localhost', 'root','', 'delivery')
              or die('Error connecting to MySQL server.');
  
          $count = "SELECT MAX(id_pelanggan) FROM pelanggan";
  
          $result = mysqli_query($dbc, $count)
              or die('Error select query');
  
          if (empty($result)) {
              $id_pelanggan = 1;
          }
          else {
              $id_pelanggan = $result + 1;
          }
  </code></pre>
  
  <p>and the result was </p>
  
  <blockquote>
    <p>Object of class mysqli_result could not be converted to int in C:\xampp\htdocs\delivery\addcustomer.php</p>
  </blockquote>
  
  <p>whereas in mysql id_pelanggan datatype is int.
  can anyone help me to make it works?</p>