Database PHP注册表和数据库错误

Database PHP注册表和数据库错误,database,forms,php,Database,Forms,Php,我在这里问了几个问题,得到了很多帮助,所以我将提前感谢你提出我的下一个问题。我一直在尝试为我的童子军团队(为营地注册)创建注册系统,但我一直无法将表单中的数据发送到数据库中,然后使用PHP邮件功能发送确认电子邮件 下面是我的表格代码: <form action="include/spud/registration.php"> <h2>Group Information:</h2>

我在这里问了几个问题,得到了很多帮助,所以我将提前感谢你提出我的下一个问题。我一直在尝试为我的童子军团队(为营地注册)创建注册系统,但我一直无法将表单中的数据发送到数据库中,然后使用PHP邮件功能发送确认电子邮件

下面是我的表格代码:

    <form action="include/spud/registration.php">

                          <h2>Group Information:</h2>
                          <table width="100%" border="0" cellspacing="10">
                            <tr>
                              <td>Group Name (# &amp; Name):
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="group_name" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                            </tr>
                            <tr>
                              <td>Group Location (City it is located in: e.g. Mississauga):
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="group_location" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                            </tr>
                            <tr>
                              <td>Number of Youth Attending:
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="group_attending" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                            </tr>
                          </table>
                          <h2>Contact Information:</h2>
                          <table width="100%" border="0" cellspacing="10">
                            <tr>
                              <td width="50%">First Name:
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="name_first" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                              <td>Last Name:
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="name_last" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                            </tr>
                            <tr>
                              <td>Address:
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="address" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                              <td>Address 2 (Optional):
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="address2" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                            </tr>
                            <tr>
                              <td>City:
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="city" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                              <td>Province or State:
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="prov_state" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                            </tr>
                          </table>
                          <table width="100%" border="0" cellspacing="10">
                            <tr>
                              <td>Country:
                              <br/>
                              <div class="input-control select">
                                  <select>
                                    <option selected>Choose...</option>
                                    <option name="country">Canada</option>
                                    <option name="country">United States</option>
                                    <option name="country">Scotland</option>
                                    <option name="country">Another Country</option>
                                  </select>
                              </div>
                              </td>
                            </tr>
                            <tr>
                              <td>Postal Code (ZIP):
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="zip_code" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                            </tr>
                          </table>
                          <table width="100%" border="0" cellspacing="10">
                            <tr>
                              <td width="50%">Telephone:
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="telephone" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                              <td>Telephone (Residential or Business: Optional):
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="telephone2" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                            </tr>
                          </table>
                          <table width="100%" border="0" cellspacing="10">
                            <tr>
                              <td>Email:
                              <br />
                              <div class="input-control text">
                                  <input type="text" name="email" />
                                  <button class="btn-clear"></button>
                              </div>
                              </td>
                            </tr>
                          </table>
                          <div class="place-left">
                              <button type="submit">Submit</button>
                              <button type="reset">Reset</button>
                          </div>
                          <div class="place-right">
                              <a href="#info" class="button">Spud Camp Information</a>
                          </div>
                        </form>

组信息:
组名(#&名称):

集团位置(所在城市:如密西西比州):
出席人数:
联系方式: 名字:
姓氏:
地址:
地址2(可选):
城市:
省或州:
国家:
选择。。。 加拿大 美国 苏格兰 别国 邮政编码(邮编):
电话:
电话(住宅或商务:可选):
电邮:
提交 重置
然后将其发送到数据库阶段:

    <?php

require_once('../database.php');

/*
* Insert the data into the Database
*/

    $qry=mysql_query("INSERT INTO 

    spudcamp(group_name,group_location,group_attending,name_first,name_last,address,address2,city,prov_state,country,zip_code,telephone,telephone2,email)

    VALUES('$_POST[group_name]','$_POST[group_location]','$_POST[group_attending]','$_POST[name_first]','$_POST[name_last]','$_POST[address]','$_POST[address2]','$_POST[city]','$_POST[prov_state]','$_POST[country]','$_POST[zip_code]','$_POST[telephone]','$_POST[telephone2]','$_POST[email]', NOW() )

    ", $con);

if(!$qry)
{
    die("Query Failed: ". mysql_error());
}
else
{
    header('location:../../spud-camp.php');
}

/*
* Send an Email to Administration and to the Signed up person
*/

include('receipt_email.php');

    ?>
关闭!第9行:

$qry=mysql_query("INSERT INTO...
最后有一个NOW()

...'$_POST[email]', NOW())
删除NOW(),只需


看情况:)

看起来您没有将POST指定为表单方法,但正在尝试访问POST变量。将表单方法设置为post

你犯了什么错误?你期望发生什么?发生了什么事?您得到的和期望得到的有什么区别?您不能将其分解为更简单的用例?我当前得到的错误是:查询失败:列计数与行的值计数不匹配
...'$_POST[email]', NOW())
...'$_POST[email]')