I am not seeing anything wrong in the code there. The user should get an email as well as the seller if there ad/auction has been purchased. Now if its quantities then of course the ad or auction does not exist just the quantity gets reduced.
If you have more specific information as to the nature of what you think is wrong that would help as well so I can explain how things are suppose to work.
Now if you have a link to the phpmyadmin on the server so I can look up purchases and compare the products table information that would help alot.