I'm working on a registration app in android studio(with PHP and MYSQL). In my database I have two tables:
table1 (For saving firstName and lastname)
and
table2 (contains 100 activation codes).
In register activity I have 3 fields: FirstName
, LastName
and activation code
.
Before the user data is inserted into table1, this is very important that activation code must be checked with data in table2. If this value exists in table2, then the data is inserted into table1(registration done) and after successful import, delete the same value(activation code) in table2. If data does not exist in table2, then data is not inserted and show a toast error.
I'm new at this, so bear with me. Thank you in advance.