表格未插入

时间:2018-07-16 16:27:05

标签: php mysql

我有一个表单,尝试在mysql中插入该表单。表单返回致命错误的bool(false)

  

致命错误:未捕获错误:在C:\ xampp \ htdocs \ xxx \ jobs.php:444中对布尔值调用成员函数bind_param()堆栈跟踪:#0 {main}抛出在C:\ xampp \ htdocs中\ xxx \ jobs.php,位于第444行。

如何解决此问题。

jobs.php

<?php
                         include ('admin/config.php');

                     if(isset($_POST['template-jobform-apply'])) {

                        $sql = "INSERT INTO apply_job (template-jobform-fname,template-jobform-email,template-jobform-phone,template-jobform-application) VALUES ('?,?,?,?')";
                        $stmt = mysqli_prepare($db,$sql);
                        var_dump($stmt);
                        $stmt->bind_param("ssss", $_POST['template-jobform-fname'], $_POST['template-jobform-email'], $_POST['template-jobform-phone'], $_POST['template-jobform-application']);

                        $stmt->execute();

                        echo "<p style='text-align: center'>Job Applied Succesfully</p>";


                      }
                    ?>

<form class="" id="template-jobform" name="template-jobform" method="post" action="" role="form">

                    <div class="form-group">

                        <div class="cols-sm-10">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-user fa" aria-hidden="true"></i></span>
                                <input type="text" class="form-control" name="template-jobform-fname" id="name"  placeholder="Enter your Name"/>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">

                        <div class="cols-sm-10">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-envelope fa" aria-hidden="true"></i></span>
                                <input type="text" class="form-control" name="template-jobform-email" id="email" placeholder="Enter your Email"/>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="cols-sm-10">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-phone fa" aria-hidden="true"></i></span>
                                <input type="phone" class="form-control" name="template-jobform-phone" id="mobile" placeholder="Mobile Number"/>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">

                        <div class="cols-sm-10">
                            <div class="input-group">

                                <input type="file" 
                                   class="filepond"
                                   name="template-jobform-application"
                                   multiple
                                   data-max-file-size="3MB"
                                   data-max-files="3" />
                            </div>
                        </div>
                    </div>

                    <div class="form-group ">
                        <button target="_blank" type="submit" name="template-jobform-apply" class="btn btn-primary btn-lg btn-block login-button">Apply</button>
                    </div>

                </form>

0 个答案:

没有答案