Soldato
Hi,
Learning PHP & SQL at the moment and I'm writing a quiz database for our employees to use in their day to day activities.
I've got a form page + a script for entering data in to the table and that works fine, if it's a slow process. Thinking I will enter info in to a spreadsheet and just import it (think that is possible).
The main page is basically 2 text boxes. first is the number of questions they want and the second is the subject they want the questions to be about.
Each question has a main subject (general knowledge etc) and then 4 tags that can be searched. I've figured out how to pull all the questions and print them to the results page.
Next step is to randomly pull X amount of questions and only display those.
Am I better doing this with SQL, ie "pull 10 random questions about football" or would I be better off pulling all the football questions and then using PHP to randomly pull 10 questions from it (if that is possible).
Silly question I know but aren't they always when you start out
Will probably end up tidying code as I learn and go, it's a little messy in places. Also need to protect from injection but that will come when its working.
Learning PHP & SQL at the moment and I'm writing a quiz database for our employees to use in their day to day activities.
I've got a form page + a script for entering data in to the table and that works fine, if it's a slow process. Thinking I will enter info in to a spreadsheet and just import it (think that is possible).
The main page is basically 2 text boxes. first is the number of questions they want and the second is the subject they want the questions to be about.
Each question has a main subject (general knowledge etc) and then 4 tags that can be searched. I've figured out how to pull all the questions and print them to the results page.
Next step is to randomly pull X amount of questions and only display those.
Am I better doing this with SQL, ie "pull 10 random questions about football" or would I be better off pulling all the football questions and then using PHP to randomly pull 10 questions from it (if that is possible).
Silly question I know but aren't they always when you start out
Will probably end up tidying code as I learn and go, it's a little messy in places. Also need to protect from injection but that will come when its working.