代码中有某种错误,我无法发现它。与数据库的连接工作正常,我可以验证
这是 HTML 中的 HTML 代码 我创建了一个表单来将数据插入数据库
<!DOCTYPE html>
<html class="html">
<form method="post" name="Draw" action="form/insertdata.php">
<input type="date" name="form_fields[date] " >
<input type="number" name="form_fields[am113d]" >
<input type="number" name="form_fields[am112d]">
<input type="number" name="form_fields[am111d]" >
<input type="number" name="form_fields[pm13d]" >
<input type="number" name="form_fields[pm12d]" >
<input type="number" name="form_fields[pm11d]" >
<input type="number" name="form_fields[pm53d]" >
<input type="number" name="form_fields[pm52d]" >
<input type="number" name="form_fields[pm51d]">
<input type="number" name="form_fields[pm63d]">
<input type="number" name="form_fields[pm62d]">
<input type="number" name="form_fields[pm61d]">
<input type="number" name="form_fields[pm73d]">
<input type="number" name="form_fields[pm72d]" >
<input type="number" name="form_fields[pm71d]" >
<button type="submit" name="submit">Submit</button>
</form>
</html>
这是PHP代码
这是从 HTML 表单中收集数据并将其存储到 MySql 数据库中的 PHP 代码
*如果我使用此代码,只有一个空行被插入到数据库中,表单中输入的值不会被插入 *
<?php
include_once 'Configuration.php';
$Dateee = $_POST['form_fields[date]'];
$am113d = $_POST['form_fields[am113d]'];
$am112d = $_POST['form_fields[am112d]'];
$am111d = $_POST['form_fields[am111d]'];
$pm13d = $_POST['form_fields[pm13d]'];
$pm12d = $_POST['form_fields[pm12d]'];
$pm11d = $_POST['form_fields[pm11d]'];
$pm53d = $_POST['form_fields[pm53d]'];
$pm52d = $_POST['form_fields[pm52d]'];
$pm51d = $_POST['form_fields[pm51d]'];
$pm63d = $_POST['form_fields[pm63d]'];
$pm62d = $_POST['form_fields[pm62d]'];
$pm61d = $_POST['form_fields[pm61d]'];
$pm73d = $_POST['form_fields[pm73d]'];
$pm72d = $_POST['form_fields[pm72d]'];
$pm71d = $_POST['form_fields[pm71d]'];
慕田峪7331174
千万里不及你