title: warning :: invalid object or resource mysqli_stmt. What is the meaning and solution(s)?
body: <p>The following code is throwing the mysterious Warnings. I can't understand what they mean. What do these errors indicate and how to eradicate them?</p>
  
  <pre><code>require "conn.php";
  $q = mysqli_stmt_init($dbconn);
  $query = "SELECT users.userid FROM users WHERE users.email = ? ";
  mysqli_stmt_prepare($q, $query);
  mysqli_stmt_bind_param($q, "s", $email);
  mysqli_stmt_execute($q);
  $result = mysqli_stmt_get_result($q);
  if (mysqli_num_rows($result) == 0) {
      $q = mysqli_stmt_init($dbconn);
      $query = "INSERT INTO users ( users.first_name, users.last_name, users.mobile_no, users.email, users.password, users.reg_date) 
          VALUES (? ,? ,? ,? ,? ,NOW() )";
      mysqli_stmt_prepare($q, $query);
      mysqli_stmt_bind_param($q, "sssss", $first_name, $last_name, $mobile_number, $email, $password);
      mysqli_stmt_execute($q);
      if (mysqli_stmt_affected_rows($q) == 1) {
          echo "data inserted &lt;br&gt;";
          foreach ($_POST as $key =&gt; $val) {
              echo "$key - - - &gt; $val &lt;br&gt;";
          }
      }
  } else {
      echo "email is already registered";
  }
  </code></pre>
  
  <p>whenever I run this block of code following warnings occur</p>
  
  <pre><code>Warning: mysqli_stmt_bind_param(): invalid object or resource mysqli_stmt in /storage/emulated/0/htdocs/registration_process.php on line 66
  
  Warning: mysqli_stmt_execute(): invalid object or resource mysqli_stmt in /storage/emulated/0/htdocs/registration_process.php on line 67
  
  Warning: mysqli_stmt_get_result(): invalid object or resource mysqli_stmt in /storage/emulated/0/htdocs/registration_process.php on line 68
  
  Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /storage/emulated/0/htdocs/registration_process.php on line 70 
  </code></pre>