This page is where I will provide demonstration of taking a CSV file and converting it into a mysql database so that it can be queried and random
elements presented from it, along with the corresponding key that it is tied to.
What's the value?
I needed a way to quickly add my csv into a file that would let me test myself against the question bank I came up with..
Basically, the question(s) is/are, "do you know this vocabulary word?"
The process flow is to guess the word meaning and click next to see if you had a good idea.
If you are satisfied with the rate at which you're proceeding, you can click "next word" to generate another.
This will be my means for quizzing myself until I'm familiar with the exam vocabulary set.
Soon you can try for yourself..
To set up your own:
- Create a csv file that has the data you need, like this one
- Count the number of columns your datasheet contains by taking A-Z (=26) and create a MySQL table with that many columns. To complete this step,
you'll need to generate your own MySQL script, like this one, making sure the value starts with a letter and nothing else. Basically, you'll
want to use this template exactly, where the number of "Doc#" instances is equal to # columns and # counts through that amount.
You can generate your script using this php script I've written for this. You'll want to execute that in your environment and then use the output (such as this), replacing all the "doc" part of the MySQL script. Afterwards, you can run the MySQL script from the console or phpMyAdmin for your table.
- Once you have a mysql table, the rest is php/form generation, posting, and submitting. Completing this step should only take another 10-15 mins. of your time, if you have much experience. Let's see how it works
- You will want to set up the first php script to read the csv file into string arrays where each new value (separated by [separator]) is read into the array as a new key. Ok..sounds complicated. (bonus:) I think we'll just skip right over to the script to get us on to the next part!