您好我收到此错误,sql查询正常,这是我的代码。
$query = "INSERT into members VALUES(NULL,'$fname','$sname','$gender','$status','$dob','$phone','$address','$email','$chapter','$join_date','$cell')";
$result = mysql_query($query,$connection)
or show_error();
echo $result;
$new_member = array();
$new_member = mysql_fetch_array($result)
or die (mysql_error());
echo 'new_member =', $new_member;
mysql_close();
return $new_member;
}
答案 0 :(得分:0)
必须删除变量附近的单引号,并且$ query应该是
“插入成员VALUES(NULL,$ fname,$ sname,$ gender,$ status,$ dob,$ phone,$ address,$ email,$ chapter,$ join_date,$ cell)”;