Re: Question about array limits & practicallity
| From: | John Nichel | Date: | Thu, 22 Jan 2004 05:27:55 +0000 |
| Subject: | Re: Question about array limits & practicallity | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175399@lists.php.net to get a copy of this message | ||
Joe Harman wrote:
Thanks for your comments Chris and Rob... Chris you have great points to make, my ears are wide open... The reason I thought about storing the array in a blob is because every test generated will be different. the 102 question test will be generate randomly from a bank of 500 questions.. That means that the order of questions will also be different... So I would like to find a way to store that unique test for the student or administrator to review.. I do understand PHP & MySQL very well... But I am no master, that's why I was asking... Any other ideas or recommendations for this... Words of wisdom are also welcome :o) So thanks for your input, JoeI think the point they're trying to get across here, and the way I would do something like this is such... Setup a table in your db for questions, and for each question you have a unique id assigned to it. Now, when you want to generate a test... SELECT * FROM dbName.tableName LIMIT 120 ORDER BY RAND (SQL from the top of my head, so don't trust it. ;) Assign this test a id of some sort (random, whatever), and dump the question ID's into another table with the associated test id. Now you're not repeating the questions numerous times in your db, you have a reference, reduced the size of your db, and given your app a bit more speed when looking up the tests later on. Yes, a bit more involved than this, but that's the watered down version. Just my $0.02...grain of salt sold separately. -- By-Tor.com It's all about the Rush http://www.by-tor.com