Hello Everyone,
i have table that have some code list if user enter same code from 2 different systems and enter at the same time both user's get data, what i want is the first one will get the data the second one will only see the message that this code is already used.
the status of the colum is 'available' but if code is valid second query update the status to 'taken' but due to concurrent request two user get the same prize id.
Stored function is best for this or http://dev.mysql.com/doc/refman/5.5/en/innodb-locking-reads.html
Thanks
Rizwan