The application I’m creating will be described below:
The users makes the payment e.g. in the paypal system and I receive the reply to the cfc component of the true value
<cfif payment is "true">
1. This is where the query must be placed to get one the code from the database.
2. I move the code to another column or mark it as used.
3. I mail this code to the user.
1. How to get one code from the database and which tag functions should be used.
2. There is a possibility that users will make payments at the same time and receive the same code. How to prevent this from happening.
Send me an exemplary cfc component which will get one code from the database and then send it to the user and mark it as used. This will counteract situations in which one code is used many times.
I used the following function:
SELECT TOP 1 * or <cfset Row = randRange(1,qInfo.recordcount)>
However, there have been some situations in which I sent the given code to several users.
I use Coldfusion 9, sql server 2008, actionscript 3.0