I don't feel like formatting the syntax properly, but doing a SELECT COUNT(*) from SALES where TXN_ID = $PRO_ID could be used to find if the TXN_ID you want to use is already being used. Then you could check to see if the variable you store the COUNT query in is equal to 0 or not.
While that...
I don't feel like formatting the syntax properly, but doing a SELECT COUNT(*) from SALES where TXN_ID = $PRO_ID could be used to find if the TXN_ID you want to use is already being used. Then you could check to see if the variable you store the COUNT query in is equal to 0 or not.
While that...