the problem with paypal payment buttons is that it is not a real time payment method.
just because the user is directed back to the success page, does not mean the payment has been made successfully. it only means that paypal has accepted the payment method and has placed the transaction in a queue to be processed with the merchant bank.
Paypal uses a system called IPN to send a post to your site with the status of the transaction once it is actually processed. you would need to create a page to accept the IPN post and update the database based on the results of the paypal IPN post.
for more details on paypal IPN see the following page: