Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php CRUD在创建记录时给我500个内部服务器错误_Php_Html_Mysql - Fatal编程技术网

php CRUD在创建记录时给我500个内部服务器错误

php CRUD在创建记录时给我500个内部服务器错误,php,html,mysql,Php,Html,Mysql,我只是想在我的players表中创建一个记录来测试我的php是否工作,但是每次单击我的submit,我都会得到一个500错误,而不是我的url错误处理程序,如果我的域数据不正确或者字段为空,那么应该返回这个错误处理程序 我确实有一个保存我的用户数据的会话 我的用户创建php works,这是我基于我的播放器创建php代码的基础。我会发布我的表格,这样你可以看到我的结构和我的php包括和我的HTML请任何帮助将是伟大的 我的php包含代码-------------- <?php sessi

我只是想在我的players表中创建一个记录来测试我的php是否工作,但是每次单击我的submit,我都会得到一个500错误,而不是我的url错误处理程序,如果我的域数据不正确或者字段为空,那么应该返回这个错误处理程序

我确实有一个保存我的用户数据的会话

我的用户创建php works,这是我基于我的播放器创建php代码的基础。我会发布我的表格,这样你可以看到我的结构和我的php包括和我的HTML请任何帮助将是伟大的

我的php包含代码--------------

<?php
session_start();
include_once 'header.php';

include 'includes/dbh.php';

?>

    <!-- ============================================================== -->
    <!-- Page Content -->
    <!-- ============================================================== -->
    <div id="page-wrapper">
        <div class="container-fluid">
            <div class="row bg-title">
                <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                    <h4 class="page-title">Profile page</h4> </div>
                <div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
                    <button class="right-side-toggle waves-effect waves- 
  light btn-info btn-circle pull-right m-l-20"><i class="ti-settings text- 
  white"></i></button>

                    <ol class="breadcrumb">
                        <li><a href="./index.php">Dashboard</a></li>
                        <li class="active">Profile page</li>
                    </ol>
                </div>
            </div>

                            <div class="tab-pane active" id="settings">
                                <form class="form-horizontal form-material" 
action="includes/profile-inc.php" method="POST">


                                    <div class="form-group">
                                        <label class="col-md-12">First 
Name</label>
                                        <div class="col-md-12">
                                            <input type="text" required="" 
name="player_first" value ="<?php echo $user_first ?>" class="form-control 
form-control-line"> </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-12">Last 
Name</label>
                                        <div class="col-md-12">
                                            <input type="text" required="" 
name="player_last" value ="<?php echo $user_last ?>" class="form-control 
form-control-line"> </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="example-email" 
class="col-md-12">Mobile</label>
                                        <div class="col-md-12">
                                            <input type="text" required="" 
name="player_mobile" value ="<?php echo $player_mobile ?>" class="form- 
control form-control-line"> </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="example-email" 
class="col-md-12">Address</label>
                                        <div class="col-md-12">
                                            <input type="address" 
required="" name="player_address" value ="<?php echo $player_address ?>" 
class="form-control form-control-line"> </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md- 
 12">City</label>
                                        <div class="col-md-12">
                                            <input type="text" required="" 
 name="player_city" value ="<?php echo $player_city ?>" class="form-control 
 form-control-line"> </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md- 
 12">State</label>
                                        <div class="col-md-12">
                                            <input type="text" required="" 
 name="player_state" value ="<?php echo $player_state ?>" class="form- 
 control 
 form-control-line"> </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-12">Zip</label>
                                        <div class="col-md-12">
                                            <input type="text" required="" 
name="player_zip" value ="<?php echo $player_zip ?>" class="form-control 
form-control-line"> </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-12">Date of 
Birth</label>
                                        <div class="col-md-12">
                                            <input type="date" required="" 
name="player_dob" value ="<?php echo $player_dob ?>" class="form-control 
form-control-line"> </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md- 
12">Gender</label>
                                        <div class="col-md-12">
                                            <input type="text" required="" 
name="player_gender" value ="<?php echo $player_gender ?>" class="form- 
control form-control-line"> </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md- 
12">User_id</label>
                                        <div class="col-md-12">
                                            <input type="text" required="" 
name="player_id" value ="<?php echo $user_id ?>" class="form-control form- 
control-line"></div>
                                    </div>

                                    <div class="form-group">
                                        <div class="col-sm-12">
                                            <button class="btn btn-success" 
type="submit" name="submit">Update Profile</button>
                                        </div>
                                    </div>
                                    </div>


                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /.row -->
            <!-- 
============================================================== -->
            <!-- Right sidebar -->
            <!-- 
============================================================== -->
            <!-- .right-sidebar -->
            <div class="right-sidebar">
                <div class="slimscrollright">
                    <div class="rpanel-title"> Service Panel <span><i 
class="ti-close right-side-toggle"></i></span> </div>
                    <div class="r-panel-body">
                        <ul id="themecolors" class="m-t-20">
                            <li><b>With Light sidebar</b></li>
                            <li><a href="javascript:void(0)" data- 
theme="default" class="default-theme">1</a></li>
                            <li><a href="javascript:void(0)" data- 
theme="green" class="green-theme">2</a></li>
                            <li><a href="javascript:void(0)" data- 
theme="gray" class="yellow-theme">3</a></li>
                            <li><a href="javascript:void(0)" data- 
theme="blue" class="blue-theme">4</a></li>
                            <li><a href="javascript:void(0)" data- 
theme="purple" class="purple-theme">5</a></li>
                            <li><a href="javascript:void(0)" data- 
theme="megna" class="megna-theme">6</a></li>
                            <li><b>With Dark sidebar</b></li>
                            <br/>
                            <li><a href="javascript:void(0)" data- 
theme="default-dark" class="default-dark-theme">7</a></li>
                            <li><a href="javascript:void(0)" data- 
theme="green-dark" class="green-dark-theme">8</a></li>
                            <li><a href="javascript:void(0)" data- 
theme="gray-dark" class="yellow-dark-theme">9</a></li>
                            <li><a href="javascript:void(0)" data- 
theme="blue-dark" class="blue-dark-theme">10</a></li>
                            <li><a href="javascript:void(0)" data- 
theme="purple-dark" class="purple-dark-theme">11</a></li>
                            <li><a href="javascript:void(0)" data- 
theme="megna-dark" class="megna-dark-theme working">12</a></li>
                        </ul>
                        <ul class="m-t-20 all-demos">
                            <li><b>Choose other demos</b></li>
                        </ul>

                    </div>
                </div>
            </div>
            <!-- 
 ============================================================== -->
            <!-- End Right sidebar -->
            <!-- 
 ============================================================== -->
        </div>
        <!-- /.container-fluid -->
<?php
            include_once 'footer.php';
            ?>

个人资料页
  • 配置文件页面
  • 弗斯特 名称

    ------------------------------------------------------------html/php代码的结尾

    请参阅
    错误日志
    非常有用,感谢添加错误日志确实很有帮助,简单的事情如
    player\u last,
    中的额外逗号就会出现。是的,你们是对的,我不是想挖苦人,我检查了我的错误日志,我的include中缺少了一个结束“}”。现在我有一个不同的问题,我的一个字段为空的错误处理程序正在我的url中返回,所以现在我已经通过了我的空url错误并返回了我的成功消息。只有一个问题我的phpmyadmin数据库中的数据没有更新这怎么可能?我查了错误日志没有什么新的
    <?php
    session_start();
    include_once 'header.php';
    
    include 'includes/dbh.php';
    
    ?>
    
        <!-- ============================================================== -->
        <!-- Page Content -->
        <!-- ============================================================== -->
        <div id="page-wrapper">
            <div class="container-fluid">
                <div class="row bg-title">
                    <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                        <h4 class="page-title">Profile page</h4> </div>
                    <div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
                        <button class="right-side-toggle waves-effect waves- 
      light btn-info btn-circle pull-right m-l-20"><i class="ti-settings text- 
      white"></i></button>
    
                        <ol class="breadcrumb">
                            <li><a href="./index.php">Dashboard</a></li>
                            <li class="active">Profile page</li>
                        </ol>
                    </div>
                </div>
    
                                <div class="tab-pane active" id="settings">
                                    <form class="form-horizontal form-material" 
    action="includes/profile-inc.php" method="POST">
    
    
                                        <div class="form-group">
                                            <label class="col-md-12">First 
    Name</label>
                                            <div class="col-md-12">
                                                <input type="text" required="" 
    name="player_first" value ="<?php echo $user_first ?>" class="form-control 
    form-control-line"> </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-12">Last 
    Name</label>
                                            <div class="col-md-12">
                                                <input type="text" required="" 
    name="player_last" value ="<?php echo $user_last ?>" class="form-control 
    form-control-line"> </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="example-email" 
    class="col-md-12">Mobile</label>
                                            <div class="col-md-12">
                                                <input type="text" required="" 
    name="player_mobile" value ="<?php echo $player_mobile ?>" class="form- 
    control form-control-line"> </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="example-email" 
    class="col-md-12">Address</label>
                                            <div class="col-md-12">
                                                <input type="address" 
    required="" name="player_address" value ="<?php echo $player_address ?>" 
    class="form-control form-control-line"> </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md- 
     12">City</label>
                                            <div class="col-md-12">
                                                <input type="text" required="" 
     name="player_city" value ="<?php echo $player_city ?>" class="form-control 
     form-control-line"> </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md- 
     12">State</label>
                                            <div class="col-md-12">
                                                <input type="text" required="" 
     name="player_state" value ="<?php echo $player_state ?>" class="form- 
     control 
     form-control-line"> </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-12">Zip</label>
                                            <div class="col-md-12">
                                                <input type="text" required="" 
    name="player_zip" value ="<?php echo $player_zip ?>" class="form-control 
    form-control-line"> </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-12">Date of 
    Birth</label>
                                            <div class="col-md-12">
                                                <input type="date" required="" 
    name="player_dob" value ="<?php echo $player_dob ?>" class="form-control 
    form-control-line"> </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md- 
    12">Gender</label>
                                            <div class="col-md-12">
                                                <input type="text" required="" 
    name="player_gender" value ="<?php echo $player_gender ?>" class="form- 
    control form-control-line"> </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md- 
    12">User_id</label>
                                            <div class="col-md-12">
                                                <input type="text" required="" 
    name="player_id" value ="<?php echo $user_id ?>" class="form-control form- 
    control-line"></div>
                                        </div>
    
                                        <div class="form-group">
                                            <div class="col-sm-12">
                                                <button class="btn btn-success" 
    type="submit" name="submit">Update Profile</button>
                                            </div>
                                        </div>
                                        </div>
    
    
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.row -->
                <!-- 
    ============================================================== -->
                <!-- Right sidebar -->
                <!-- 
    ============================================================== -->
                <!-- .right-sidebar -->
                <div class="right-sidebar">
                    <div class="slimscrollright">
                        <div class="rpanel-title"> Service Panel <span><i 
    class="ti-close right-side-toggle"></i></span> </div>
                        <div class="r-panel-body">
                            <ul id="themecolors" class="m-t-20">
                                <li><b>With Light sidebar</b></li>
                                <li><a href="javascript:void(0)" data- 
    theme="default" class="default-theme">1</a></li>
                                <li><a href="javascript:void(0)" data- 
    theme="green" class="green-theme">2</a></li>
                                <li><a href="javascript:void(0)" data- 
    theme="gray" class="yellow-theme">3</a></li>
                                <li><a href="javascript:void(0)" data- 
    theme="blue" class="blue-theme">4</a></li>
                                <li><a href="javascript:void(0)" data- 
    theme="purple" class="purple-theme">5</a></li>
                                <li><a href="javascript:void(0)" data- 
    theme="megna" class="megna-theme">6</a></li>
                                <li><b>With Dark sidebar</b></li>
                                <br/>
                                <li><a href="javascript:void(0)" data- 
    theme="default-dark" class="default-dark-theme">7</a></li>
                                <li><a href="javascript:void(0)" data- 
    theme="green-dark" class="green-dark-theme">8</a></li>
                                <li><a href="javascript:void(0)" data- 
    theme="gray-dark" class="yellow-dark-theme">9</a></li>
                                <li><a href="javascript:void(0)" data- 
    theme="blue-dark" class="blue-dark-theme">10</a></li>
                                <li><a href="javascript:void(0)" data- 
    theme="purple-dark" class="purple-dark-theme">11</a></li>
                                <li><a href="javascript:void(0)" data- 
    theme="megna-dark" class="megna-dark-theme working">12</a></li>
                            </ul>
                            <ul class="m-t-20 all-demos">
                                <li><b>Choose other demos</b></li>
                            </ul>
    
                        </div>
                    </div>
                </div>
                <!-- 
     ============================================================== -->
                <!-- End Right sidebar -->
                <!-- 
     ============================================================== -->
            </div>
            <!-- /.container-fluid -->
    <?php
                include_once 'footer.php';
                ?>