我正在尝试通过输入字段在 mysql 中添加数据,但我的查询无法正常工作。我有九列和九个输入字段。我知道;实际上我是初学者,不保存插入数据的方法。
我的 html 输入字段
<form method="post" >
<table>
<tr>
<td>Name</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td>Father Name</td>
<td><input type="text" name="father" /></td>
</tr>
<tr>
<td>Monthly Income</td>
<td><input type="text" name="income" /></td>
</tr>
<tr>
<td>Wasiyat Number</td>
<td><input type="text" name="wnumber" /></td>
</tr>
<tr>
<td>Wasiyat Fund</td>
<td><input type="text" name="wasiyat" /></td>
</tr>
<tr>
<td>Tahrikaa Jadid Fund</td>
<td><input type="text" name="tahrikaa" /></td>
</tr>
<tr>
<td>Waqfi Jadid Fund</td>
<td><input type="text" name="waqfi" /></td>
</tr>
<tr>
<td>Local Fund</td>
<td><input type="text" name="local" /></td>
</tr>
<tr>
<td>Jalsa Salana Fund</td>
<td><input type="text" name="jalsa" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="add" /></td>
</tr>
</table>
这是我的一些 php 代码,用于获取表单帖子并进行查询。上次当我在此查询中运行具有 var_dump 值的代码时。php
<?php
if (isset($_POST['submit']))
{
include 'db.php';
$title=$_POST['name'] ;
$author= $_POST['father'] ;
$name=$_POST['income'] ;
$copy=$_POST['wnumber'] ;
$wasiyat=$_POST['wasiyat'];
$tahrikaa_jadid=$_POST['tahrikaa'];
$waqfi_jadid=$_POST['waqfi'];
$local_fund=$_POST['local'];
$jalsa=$_POST['jalsa'];
$insert=mysql_query("INSERT INTO `books`('name','father_name','monthly_income','wasiyat_number','wasiyat_fund','tahrikaa_jadid_fund','waqfi_jadid_fund','local_fund','jalsa_salana_fund')
VALUES ('$title','$author','$name','$copy',$wasiyat,$tahrikaa_jadid,$waqfi_jadid,$local_fund,$jals a)");
}
?>