这里是我的php程序:
public function updateUser($id,$name,$lname,$username,$password,$gender,$email,$mobile,$address) {
printF($id);
$update = ("UPDATE oops SET firstname = '$name',lastname = '$lname', username= '$username',password='$password',email = '$email', gender = '$gender', mobile = '$mobile' , address = '$address' WHERE uid = '$id'");
printF($update);
$result = mysql_query($update);
if ($result) {
return true;
} else {
return false;
}
}
答案 0 :(得分:0)
尝试从$update
变量和DO NOT
使用mysql_*
功能中删除()括号,使用mysqli_*
代替mysql_*
public function updateUser($id,$name,$lname,$username,$password,$gender,$email,$mobile,$address) {
printF($id);
$update = "UPDATE oops SET firstname = '$name',lastname = '$lname', username= '$username',password='$password',email = '$email', gender = '$gender', mobile = '$mobile' , address = '$address' WHERE uid = '$id'";
printF($update);
$result = mysqli_query($update);
if ($result) {
return true;
} else {
return false;
}
}