The most obvious thing (IMHO) would be to check the boolean return value (i.e. true / false) from the query execution statement.
// do the connecting stuff (this example uses MySQL)
$success = mysql_query("UPDATE ... ", $connection);
if ($success == true)
// redirect to the "success page", or just print or echo right here
// something went wrong - take appropriate action (display error page, email admin, save log, dump environment, etc.)