Current location: Hot Scripts Forums » Programming Languages » PHP » Want to check in the database if the txn_id has been used before

Want to check in the database if the txn_id has been used before

 
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-29-06, 01:10 PM
Oskare100 Oskare100 is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Want to check in the database if the txn_id has been used before

Hello,
When Paypal runs my IPN script I save all transaction details in a table in a database.

The payment_status can be pending (if echeck and so on) or completed. I store the payment_status in the the table among with all other transaction details. Each transaction has an uniqe txn_id, I do also save the txn_id in the table.

When I payment arrives as completed I first want to check if it is a new payment that has arrived with a new txn_id or if it is an old pending payment with transaction details and a txn_id that is already in the table that has been cleared and completed.

It could also be an txn_id (transaction) that my script already has created an account for so if the payment_status in my table is "completed" for that txn_id I want it to do something else (send me an email or log it).

I don't know how advanced that it but I'm stuck and I can't figure out how to do that so please, I need some help : (

Here is what I did come up with:
$result = mysql_query("SELECT txn_id FROM paypal_sales");

But then I don't know how to find if that txn_id has been used or if the payment_status is completed or pending.

Best Regards
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Form to update a MySQL database? Scoobler PHP 9 09-04-08 02:41 AM
Search for domain name in a Database with Spell check srik4u PHP 1 03-24-06 12:06 PM
Simple, searchable book database max fischer Script Requests 0 05-14-05 02:00 PM
SQL database registration form help vinhkhuong PHP 3 10-10-03 04:49 AM


All times are GMT -5. The time now is 11:14 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.