Fatal error: Call to a member function bind_param() on boolean












0














so i have made a sign up form using xampp and i keep receiving this error
$dbname satebo registration
table = registration



this is my form



<div id="id01" class="modal">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span>
<form class="modal-content" method="post" action="insert.php">
<div class="container">
<h1><i class="fa fa-fw fa-globe"></i>Satebo</h1>
<p>Welcome to Satebo!</p>
<hr>
<label for="fullname"><b>Full Name</b></label>
<input type="text" placeholder="Enter Full Name" name="fullname" required>
<label for="name"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="username" required>
<label for="email"><b>Email</b></label>
<input type="text" placeholder="Enter Email" name="email" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<label for="pswrepeat"><b>Repeat Password</b></label>
<input type="password" placeholder="Repeat Password" name="pswrepeat" required>
<label for="contactnumber"><b>Contact Number</b></label>
<input type="text" placeholder="(XXX)XXX-XXXX" name="contactnumber" required>

<label>
<input type="checkbox" checked="checked" name="remember" style="margin-bottom:15px"> Remember me
</label>

<div class="clearfix">
<button type="submit" class="signupbtn">Sign Up</button>
<button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>

</div>
</div>
</form>
</div>
</div>


and here is my php



<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);


$fullname = $_POST['fullname'];
$username = $_POST['username'];
$email = $_POST['email'];
$psw = $_POST['psw'];
$pswrepeat = $_POST['pswrepeat'];
$contactnumber = $_POST['contactnumber'];

if(!empty($fullname) || !empty($username) ||
!empty($email) || !empty($psw) || !empty($pswrepeat) ||
!empty($contactnumber)) {
$host = "localhost";
$dbUsername = "root";
$dbPassword = "";
$dbname = "satebo registration";

//create connection
$conn = new mysqli($host, $dbUsername, $dbPassword, $dbname);
if(mysqli_connect_error()){
die('Connect Error('. mysqli_connect_errno().')'. mysqli_connect_error());
} else {
$SELECT = "SELECT email From registration Where email = ? Limit 1";
$INSERT = "INSERT Into registration (fullname, username, email, psw, pswrepeat, contactnumber) values(?, ?, ?, ?, ?, ?)";
//Prepare statement
$stmt = $conn->prepare($select);
$stmt->bind_param("s", $email);
$stmt->execute();
$stmt->bind_result($email);
$stmt->store_result();
$rnum = $stmt->num_rows;
if ($rnum==0) {
$stmt->close();
$stmt = $conn->prepare($INSERT);
$stmt->bind_param("ssssii", $fullname, $username, $email, $psw, $pswrepeat, $contactnumber);
$stmt->execute();
echo "New record inserted sucessfully";
} else{
echo "Someone already register using this email";
}
$stmt->close();
$conn->close();
}
} else {
echo "All fields are required";
die();
}
?>


I have been stuck on this for like 3 days if anyone could help me it would be greatly appreciated the error code I receive when I click submit



Notice: Undefined variable: select in C:xampphtdocsSateboinsert.php on line 29



Fatal error: Uncaught Error: Call to a member function bind_param() on bool in C:xampphtdocsSateboinsert.php:30 Stack trace: #0 {main} thrown in C:xampphtdocsSateboinsert.php on line 30









share







New contributor




Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0














    so i have made a sign up form using xampp and i keep receiving this error
    $dbname satebo registration
    table = registration



    this is my form



    <div id="id01" class="modal">
    <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span>
    <form class="modal-content" method="post" action="insert.php">
    <div class="container">
    <h1><i class="fa fa-fw fa-globe"></i>Satebo</h1>
    <p>Welcome to Satebo!</p>
    <hr>
    <label for="fullname"><b>Full Name</b></label>
    <input type="text" placeholder="Enter Full Name" name="fullname" required>
    <label for="name"><b>Username</b></label>
    <input type="text" placeholder="Enter Username" name="username" required>
    <label for="email"><b>Email</b></label>
    <input type="text" placeholder="Enter Email" name="email" required>
    <label for="psw"><b>Password</b></label>
    <input type="password" placeholder="Enter Password" name="psw" required>
    <label for="pswrepeat"><b>Repeat Password</b></label>
    <input type="password" placeholder="Repeat Password" name="pswrepeat" required>
    <label for="contactnumber"><b>Contact Number</b></label>
    <input type="text" placeholder="(XXX)XXX-XXXX" name="contactnumber" required>

    <label>
    <input type="checkbox" checked="checked" name="remember" style="margin-bottom:15px"> Remember me
    </label>

    <div class="clearfix">
    <button type="submit" class="signupbtn">Sign Up</button>
    <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>

    </div>
    </div>
    </form>
    </div>
    </div>


    and here is my php



    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', 1);


    $fullname = $_POST['fullname'];
    $username = $_POST['username'];
    $email = $_POST['email'];
    $psw = $_POST['psw'];
    $pswrepeat = $_POST['pswrepeat'];
    $contactnumber = $_POST['contactnumber'];

    if(!empty($fullname) || !empty($username) ||
    !empty($email) || !empty($psw) || !empty($pswrepeat) ||
    !empty($contactnumber)) {
    $host = "localhost";
    $dbUsername = "root";
    $dbPassword = "";
    $dbname = "satebo registration";

    //create connection
    $conn = new mysqli($host, $dbUsername, $dbPassword, $dbname);
    if(mysqli_connect_error()){
    die('Connect Error('. mysqli_connect_errno().')'. mysqli_connect_error());
    } else {
    $SELECT = "SELECT email From registration Where email = ? Limit 1";
    $INSERT = "INSERT Into registration (fullname, username, email, psw, pswrepeat, contactnumber) values(?, ?, ?, ?, ?, ?)";
    //Prepare statement
    $stmt = $conn->prepare($select);
    $stmt->bind_param("s", $email);
    $stmt->execute();
    $stmt->bind_result($email);
    $stmt->store_result();
    $rnum = $stmt->num_rows;
    if ($rnum==0) {
    $stmt->close();
    $stmt = $conn->prepare($INSERT);
    $stmt->bind_param("ssssii", $fullname, $username, $email, $psw, $pswrepeat, $contactnumber);
    $stmt->execute();
    echo "New record inserted sucessfully";
    } else{
    echo "Someone already register using this email";
    }
    $stmt->close();
    $conn->close();
    }
    } else {
    echo "All fields are required";
    die();
    }
    ?>


    I have been stuck on this for like 3 days if anyone could help me it would be greatly appreciated the error code I receive when I click submit



    Notice: Undefined variable: select in C:xampphtdocsSateboinsert.php on line 29



    Fatal error: Uncaught Error: Call to a member function bind_param() on bool in C:xampphtdocsSateboinsert.php:30 Stack trace: #0 {main} thrown in C:xampphtdocsSateboinsert.php on line 30









    share







    New contributor




    Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0







      so i have made a sign up form using xampp and i keep receiving this error
      $dbname satebo registration
      table = registration



      this is my form



      <div id="id01" class="modal">
      <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span>
      <form class="modal-content" method="post" action="insert.php">
      <div class="container">
      <h1><i class="fa fa-fw fa-globe"></i>Satebo</h1>
      <p>Welcome to Satebo!</p>
      <hr>
      <label for="fullname"><b>Full Name</b></label>
      <input type="text" placeholder="Enter Full Name" name="fullname" required>
      <label for="name"><b>Username</b></label>
      <input type="text" placeholder="Enter Username" name="username" required>
      <label for="email"><b>Email</b></label>
      <input type="text" placeholder="Enter Email" name="email" required>
      <label for="psw"><b>Password</b></label>
      <input type="password" placeholder="Enter Password" name="psw" required>
      <label for="pswrepeat"><b>Repeat Password</b></label>
      <input type="password" placeholder="Repeat Password" name="pswrepeat" required>
      <label for="contactnumber"><b>Contact Number</b></label>
      <input type="text" placeholder="(XXX)XXX-XXXX" name="contactnumber" required>

      <label>
      <input type="checkbox" checked="checked" name="remember" style="margin-bottom:15px"> Remember me
      </label>

      <div class="clearfix">
      <button type="submit" class="signupbtn">Sign Up</button>
      <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>

      </div>
      </div>
      </form>
      </div>
      </div>


      and here is my php



      <?php
      error_reporting(E_ALL);
      ini_set('display_errors', 1);


      $fullname = $_POST['fullname'];
      $username = $_POST['username'];
      $email = $_POST['email'];
      $psw = $_POST['psw'];
      $pswrepeat = $_POST['pswrepeat'];
      $contactnumber = $_POST['contactnumber'];

      if(!empty($fullname) || !empty($username) ||
      !empty($email) || !empty($psw) || !empty($pswrepeat) ||
      !empty($contactnumber)) {
      $host = "localhost";
      $dbUsername = "root";
      $dbPassword = "";
      $dbname = "satebo registration";

      //create connection
      $conn = new mysqli($host, $dbUsername, $dbPassword, $dbname);
      if(mysqli_connect_error()){
      die('Connect Error('. mysqli_connect_errno().')'. mysqli_connect_error());
      } else {
      $SELECT = "SELECT email From registration Where email = ? Limit 1";
      $INSERT = "INSERT Into registration (fullname, username, email, psw, pswrepeat, contactnumber) values(?, ?, ?, ?, ?, ?)";
      //Prepare statement
      $stmt = $conn->prepare($select);
      $stmt->bind_param("s", $email);
      $stmt->execute();
      $stmt->bind_result($email);
      $stmt->store_result();
      $rnum = $stmt->num_rows;
      if ($rnum==0) {
      $stmt->close();
      $stmt = $conn->prepare($INSERT);
      $stmt->bind_param("ssssii", $fullname, $username, $email, $psw, $pswrepeat, $contactnumber);
      $stmt->execute();
      echo "New record inserted sucessfully";
      } else{
      echo "Someone already register using this email";
      }
      $stmt->close();
      $conn->close();
      }
      } else {
      echo "All fields are required";
      die();
      }
      ?>


      I have been stuck on this for like 3 days if anyone could help me it would be greatly appreciated the error code I receive when I click submit



      Notice: Undefined variable: select in C:xampphtdocsSateboinsert.php on line 29



      Fatal error: Uncaught Error: Call to a member function bind_param() on bool in C:xampphtdocsSateboinsert.php:30 Stack trace: #0 {main} thrown in C:xampphtdocsSateboinsert.php on line 30









      share







      New contributor




      Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      so i have made a sign up form using xampp and i keep receiving this error
      $dbname satebo registration
      table = registration



      this is my form



      <div id="id01" class="modal">
      <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span>
      <form class="modal-content" method="post" action="insert.php">
      <div class="container">
      <h1><i class="fa fa-fw fa-globe"></i>Satebo</h1>
      <p>Welcome to Satebo!</p>
      <hr>
      <label for="fullname"><b>Full Name</b></label>
      <input type="text" placeholder="Enter Full Name" name="fullname" required>
      <label for="name"><b>Username</b></label>
      <input type="text" placeholder="Enter Username" name="username" required>
      <label for="email"><b>Email</b></label>
      <input type="text" placeholder="Enter Email" name="email" required>
      <label for="psw"><b>Password</b></label>
      <input type="password" placeholder="Enter Password" name="psw" required>
      <label for="pswrepeat"><b>Repeat Password</b></label>
      <input type="password" placeholder="Repeat Password" name="pswrepeat" required>
      <label for="contactnumber"><b>Contact Number</b></label>
      <input type="text" placeholder="(XXX)XXX-XXXX" name="contactnumber" required>

      <label>
      <input type="checkbox" checked="checked" name="remember" style="margin-bottom:15px"> Remember me
      </label>

      <div class="clearfix">
      <button type="submit" class="signupbtn">Sign Up</button>
      <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>

      </div>
      </div>
      </form>
      </div>
      </div>


      and here is my php



      <?php
      error_reporting(E_ALL);
      ini_set('display_errors', 1);


      $fullname = $_POST['fullname'];
      $username = $_POST['username'];
      $email = $_POST['email'];
      $psw = $_POST['psw'];
      $pswrepeat = $_POST['pswrepeat'];
      $contactnumber = $_POST['contactnumber'];

      if(!empty($fullname) || !empty($username) ||
      !empty($email) || !empty($psw) || !empty($pswrepeat) ||
      !empty($contactnumber)) {
      $host = "localhost";
      $dbUsername = "root";
      $dbPassword = "";
      $dbname = "satebo registration";

      //create connection
      $conn = new mysqli($host, $dbUsername, $dbPassword, $dbname);
      if(mysqli_connect_error()){
      die('Connect Error('. mysqli_connect_errno().')'. mysqli_connect_error());
      } else {
      $SELECT = "SELECT email From registration Where email = ? Limit 1";
      $INSERT = "INSERT Into registration (fullname, username, email, psw, pswrepeat, contactnumber) values(?, ?, ?, ?, ?, ?)";
      //Prepare statement
      $stmt = $conn->prepare($select);
      $stmt->bind_param("s", $email);
      $stmt->execute();
      $stmt->bind_result($email);
      $stmt->store_result();
      $rnum = $stmt->num_rows;
      if ($rnum==0) {
      $stmt->close();
      $stmt = $conn->prepare($INSERT);
      $stmt->bind_param("ssssii", $fullname, $username, $email, $psw, $pswrepeat, $contactnumber);
      $stmt->execute();
      echo "New record inserted sucessfully";
      } else{
      echo "Someone already register using this email";
      }
      $stmt->close();
      $conn->close();
      }
      } else {
      echo "All fields are required";
      die();
      }
      ?>


      I have been stuck on this for like 3 days if anyone could help me it would be greatly appreciated the error code I receive when I click submit



      Notice: Undefined variable: select in C:xampphtdocsSateboinsert.php on line 29



      Fatal error: Uncaught Error: Call to a member function bind_param() on bool in C:xampphtdocsSateboinsert.php:30 Stack trace: #0 {main} thrown in C:xampphtdocsSateboinsert.php on line 30







      php html





      share







      New contributor




      Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 mins ago









      Ghost

      11




      11




      New contributor




      Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.



























          active

          oldest

          votes











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "196"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Ghost is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f210544%2ffatal-error-call-to-a-member-function-bind-param-on-boolean%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Ghost is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Ghost is a new contributor. Be nice, and check out our Code of Conduct.













          Ghost is a new contributor. Be nice, and check out our Code of Conduct.












          Ghost is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Code Review Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f210544%2ffatal-error-call-to-a-member-function-bind-param-on-boolean%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          TypeError: fit_transform() missing 1 required positional argument: 'X'