Your host may have already installed phpMyAdmin or some other tool to manage the database graphically. Installing it yourself would probably not be a good idea as it requires some configuration and decisions to ensure it is secure.
We can't help you with the design and creation of the table. Creating a new table might be a good idea, to keep it separate from your WordPress tables, but that complicates access a little bit. It seems though that your table will be very simple, just one column of values. You could even just create a plain text file and store it on your web server somewhere, where it's not publicly accessible and downloadable. That might be an easier solution.
You could create the file with one value per line just as you have pasted.
On a very high level, you would need to read the code that is entered. So a simple one field form to check the code. If the code is valid, continue to the next form. Or, you can check the code entered on the form with all the other information, but if it's invalid, then they wasted their time entering all the information. That part is up to you: one form or two.
So, read the code. Compare the code to all valid codes. If there is a match, let them continue, show success, something like that. If it fails, return a validation error and let them try again.
Does it sound like a text file will work for you, or do you want to create a database table?
Posted 10 years ago on Friday December 2, 2011 | Permalink