Mysql中嵌套入PHP的POST参数$_POST["id"]

很多操作需要在mysql语句中,嵌套入POST参数。我写了一个,修改了很长时间才改好。

不同的语句,对于$_POST['id']的引用是不同的。

首先来说INSERT语句:

	$con = $_POST['fname']; 
	$conn = $_POST['age']; 
	
    $sql = "insert into admin (aaccount, acode) values ('$con' , '$conn' ) ";
	$connt = $dbh->exec($sql)or die(print_r($dbh->errorInfo(), true));

经过实验后,检测后是正确的。

猜你喜欢

转载自blog.csdn.net/lee18254290736/article/details/79851895