$txtmemberid = $_POST['txtmemberid'];
$txtname = $_POST['txtname'];
$txtphoneno = $_POST['txtphoneno'];
$txtmembertype = $_POST['txtmembertype'];
$query = "insert into member(member_id, name, ph_no, member_type) values(:member_id, :name, :ph_no, :member_type)";
try{
$stmt = $conn -> prepare($query);
$stmt -> bindParam(':member_id', $txtmemberid);
$stmt -> bindParam(': name', $txtname);
$stmt -> bindParam(':ph_no', $txtphoneno);
$stmt -> bindParam(':member_type', $txtmembertype);
$stmt -> execute();
}
答案 0 :(得分:1)
你的问题很可能在这一行:
$stmt -> bindParam(': name',$txtname);
:
和name
之间有无关的空白,请将其更改为:
$stmt -> bindParam(':name',$txtname);