为什么 我的添加的代码只能添加数字呢 .添加字母和 中文的话 ,不报错,也不录入数据库!
代码 如下:
<?php 
include ("conn.php");
$csql=mysql_query("select * from certificate where id=".$_POST['id']."");
$row=mysql_fetch_array($csql);if(empty($row)){
$sql=mysql_query("insert into certificate(id,Validity,Name,City,Country)values(".$_POST['id'].",".$_POST['Validity'].",".$_POST['Name'].",".$_POST['City'].",".$_POST['Country'].")");
echo "<script>alert('Add a new record success!');";
}else{
echo "<script>alert('Repeat Validity records!');";
}
mysql_close($conn);
?>