Fatti un echo dei vari $_GET e togli un attimo mysqli_real_escape_string