I am not familiar with XML or Flash, but I am guessing that is not much of an issue for you right now. It sounds like it is going to take some time for you to write this script even if it is just entering the data into your database. I hope you have a good server that can handle the load of so many visitors going to your site, but that's another issue. You only need one databse. When dealing with multiple languages collation may be an issue, but I really doubt it. Most likely you are already familiar with collation or it is not important.
To start you want to create a normalized table. The following can get a little complicated if you are not familiar with normalized tables. I am keeping the following pretty simple for simplicity sake.
First table: contains your questions, answers, quiz format, language, and question ID number.
Second table: tags for each question such as the category used (this can also contain the sub category names or you can create another table for the subcategories). You will also need an ID column and a category ID (or sub category ID as the case may be).
Third table: This table contains an ID column, a tag ID column, and a question ID column.
More tables and relationships can be added, such as a table for the name of the language used and another for the relationship between the name of the language and the table, but that is more complicated than I have done before. In your case it sounds like it would be a good idea.
The query to gather and display the results will look something like this:
Code:
SELECT question.ID, question.format, question.answer, question.language, question.text
FROM question, question_tag_relationships
WHERE question_tag_relationships.tag_ID=$question_ID
AND question_tag_relationships.question_ID=question.ID
ORDER BY RAND() LIMIT 10
The category tags are represented by the tag's ID found in the second table. This will allow for tags to be added and renamed easily.
I would practice setting up the tables and the queries before progressing further.
Bookmarks