Php 致命错误:调用成员函数bind_param()

Php 致命错误:调用成员函数bind_param(),php,html,Php,Html,我收到以下错误消息: 致命错误:在第89行的/Applications/XAMPP/xamppfiles/htdocs/ict136/aaregistration/register/register.php中对非对象调用成员函数bind_param() 这是我的密码: <?php include('header.php'); ?> <!-- start of content --> <div class="container"> <form

我收到以下错误消息:

致命错误:在第89行的/Applications/XAMPP/xamppfiles/htdocs/ict136/aaregistration/register/register.php中对非对象调用成员函数bind_param()

这是我的密码:

<?php include('header.php'); ?>


<!-- start of content -->
<div class="container">

    <form role="form" action="" method="POST">
          <div class="row">
              <div class="col-md-4"> </div>
              <div class="col-md-4"><h3><center><strong>Member Registration</strong> </center></h3></div>
              <div class="col-md-4"> </div>
          </div>
          <div class="row">
              <div class="col-md-4"> </div>
              <div class="col-md-4"> <input type="text"       required name="fullname"   id="fullname"                placeholder="enter full name"></div>
              <div class="col-md-4"> </div>
            </div>

              <div class="row">
              <div class="col-md-4"> </div>
              <div class="col-md-4"> <input type="text"       required name="address"     id="fullname"               placeholder="enter address"></div>
              <div class="col-md-4"> </div>
            </div>

           <div class="row">
              <div class="col-md-4"> </div>
              <div class="col-md-4"><input type="email"       required name="email"       id="exampleInputEmail1"     placeholder="Enter email"></div>
              <div class="col-md-4"> </div>
          </div>
            <div class="row">
              <div class="col-md-4"> </div>
              <div class="col-md-4"> <input type="date"       required name="bday"        id="exampleInputDate1"              placeholder="(YYYY-MM-DD)"></div>
              <div class="col-md-4"> </div>
          </div>

           <div class="row">
              <div class="col-md-4"> </div>
              <div class="col-md-4"> <input type="password"   required name="password"    id="exampleInputPassword1"  placeholder="Password"></div>
              <div class="col-md-4"> </div>
          </div>
                   <div class="row">
              <div class="col-md-4"></div>
              <div class="col-md-4">  <button type="submit" name="submit" value="submit" class="btn btn-default">Submit</button></div>
              <div class="col-md-4"></div>
          </div
           <div class="row">
              <div class="col-md-4"> </div>
              <div class="col-md-4">
              <?php
                 if(isset($_POST['submit'])){
                 echo "Thank you for registering  ".$_POST['fullname']."!";


                 //assigning the values from the form to the variables after cleaning
                 $name=$_POST['fullname'];
                 $address=$_POST['address'];
                 $email=$_POST['email'];
                 $happybday=$_POST['bday'];
                 $pword=$_POST['password'];




                 //open a connection to the database
                 $con=mysqli_connect("localhost","root","","firstmatesales") ;

                //checking if it is successful

                if(mysqli_connect_errno())
                {
                //greater than 0 - has error

                echo "<br/>Error connecting to database hehehe";
                exit();
                }else
                         {
               //0 means false - no error
                echo "<br/>Well played! connected to database!";

                $sqlstmt="insert into firstmatesales(customername,customeraddress,customeremail,customerbirthday,password) values(?,?,?,?,?)";

                 //$name=$_POST['fullname'];
                 //$address=$_POST['address'];
                 //$email=$_POST['email'];
                //$happybday=$POST['bday'];
                 //$pword=$_POST['password'];


                $stmt=$con->prepare ($sqlstmt);
 <!--line 89--> $stmt->bind_param('sssss', $name, $address, $email, $happybday, $pword);
                $stmt->execute();                
                          }

                 }
                 else
                 {
                  echo "please register your information";
                  }
              ?>

              </div>
              <div class="col-md-4"> </div>
          </div>
    </form>

</div>   
<!-- end of content --> 

<?php include('footer.php'); ?>

会员注册
提交

你需要知道一些事情

调用非对象上的成员函数bind_param()
表示您试图调用的
bind_param
不是对象

为什么它不是一个物体?因为
$mysqli->prepare
没有返回对象。为什么它不返回一个对象


这意味着一定发生了错误。您应该打开,这可能会告诉您,或者检查,这也可能会告诉您。

将错误报告添加到文件顶部
错误报告(E\u ALL);ini设置(“显示错误”,1);mysqli_报告(mysqli_报告错误| mysqli_报告严格)如果你还没有这样做。你的表单标签没有按应有的方式设置。你的代码没有问题。请检查您的列名,并确保您选择了正确的数据库和/或表。thnks我已经解决了这个问题,对不起,我在编码方面是新手,错误在$sqlstmt=“insert into firstmatesales(customername、customeraddress、CustomerMail、customerbirthday、password)值(?,,,,?)”;我没有给表命名,而是给数据库命名,所以我改变了它。to$sqlstmt=“插入到客户(客户名称、客户地址、客户邮件、客户生日、密码)值(?、、?、?、?)”;这是错误代码,弗雷德爵士。这帮了大忙:)先生,我是新来的编码员,你能告诉我在错误的行前面插入/放置$mysqli->error()。。绑定参数前的平均值