变量声明: -
# Get object's boolean field and toggle it
# @param [Object] mongoid object
# @param [String, Symbol] flag
# @example
# foo = User.find('123')
# toggle_flag!(object: foo, flag: :bar)
def toggle_flag!(object:, flag:)
object.update(flag => !object[flag])
object.save!
end
语法错误意外' $ firstname' (T_VARIABLE)第21行
答案 0 :(得分:3)
试试这个
$sql = "INSERT INTO people (firstname, surname, id,
faculty_of_study, enrolled_course, gender, password, telephone_no,
email_address) VALUES ('$firstname', '$surname', '$id',
'$faculty_of_study',
'$enrolled_course', '$gender','$password', '$telephone_no','$email_address')";
答案 1 :(得分:0)
试试这个
$sql = "INSERT INTO people (firstname, surname, id,faculty_of_study, enrolled_course, gender, password, telephone_no, email_address) VALUES ('".$firstname."', '".$surname."', '".$id."', '".$faculty_of_study."', '".$enrolled_course."', '".$gender."','".$password."', '".$telephone_no."', '".$email_address."')";
并在VALUES
之前删除分号。