0

嗨,我收到此错误,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;

}

4

1 回答 1

0

必须删除变量附近的单引号,并且 $query 应该是

"插入成员 VALUES(NULL,$fname,$sname,$gender,$status,$dob,$phone,$address,$email,$chapter,$join_date,$cell)";

于 2013-02-08T06:49:26.500 回答