我不知道我的html和php代码出了什么问题.它给出错误:查询为空


I dont know what is wrong with my html and php code.It gives Error:Query was empty

<body>

<h1><center>PHARMA DEVELOPMENT</center></h1>
<form name="reg" action="insert.php"  method="post">
<table width="274" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="95"><div align="right">username:</div></td>
<td width="171"><input type="text" name="phpro_username" /></td>
</tr>
<tr>
<td><div align="right">Password:</div></td>
<td><input type="text" name="phpro_password" /></td>
</tr>
<tr>
<td><div align="right">city:</div></td>
<td><input type="text" name="city" /></td>
</tr>
<tr>
<td><div align="right">state:</div></td>
<td><input type="text" name="state" /></td>
</tr>
<tr>
<td><div align="right">Country.:</div></td>
<td><input type="text" name="country" /></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><input name="submit" type="submit" value="Submit" /></td>
</tr>
</table>
</form>      
</body>

insert.php `<?php`

$con = mysql_connect("localhost","uai","dev@123");
if (!$con)
{

die('Could not connect: ' . mysql_error());
}
mysql_select_db("reference", $con);
$username =$_POST['phpro_username'];
$password =$_POST['phpro_password'];
$city =$_POST['city'];
$state =$_POST['state'];
$country =$_POST['country'];
$result = mysql_query("INSERT INTO phpro_salsrep(phpro_username, phpro_password, city, state, country) VALUES('$username','$password','$city','$state','$country')");
if (!mysql_query($result,$con))
{
echo "inserted sucessfully";
}
else
{
die('Error:' .mysql_error());
}
mysqli_close($con);
?>

您的<body>标记位于<head>标记中。

相关文章: