button query update

i have made a button with a query that update a field, this works, But a strange thing happens, as soon as I press the button, appears white screen and the top of the screen I have to press ok to continue, then he reappears l my page and has been made the change, but I would not bring up ok

{
$update_sql = "UPDATE checkin SET Stato pagamento = 3 WHERE id = ".{id};
sc_exec_sql($update_sql);
}

add sc_exit(); after your code, that will bring you to your application as soon as the code in the button gets executed.

Regards

works,thanks