Updated bug:
Changed the content in checkout_success.php, because sometimes the query was duplicated.

More...