You should echo something indicating the success of this. That way deleteQuestion in the Android code knows whether the deletion is successful or not, and can return a boolean indicating this. You could have $query also have a "RETURNING" clause on the end that returns the id of the question deleted, and then simply echo this id (I think you can have RETURNING on a delete from statement in postgresql, but not positive).