Hi everyone! As I'm developer, i'd like to have my data from a database in just one query (and not some loops doing the result in 2 or more SQL-statements sending them 10 or more times). In my actual project i have a db structure like the on you can find here: http://www.schlitt-design.de/fahrschule.sql
Some advices to the structure: The table "users" is used to store user-data. In "questions" there are questions, which have their answers in "answers" (referenced by the question_ID). A user can log in an generate a new test with random questions. The user solves the test and the results are saved in "tests_answers", which saves a unique "test_ID" (referencing to the user-data and date in "tests" and referencing answers from "answers"; every answer has an attribute "checked" which saves, if the user used this answer or not). So long, i think it's a good structure for saving the tests a user absolves... But i can not figure out the following data i need to display in the application: How many question has a user deald with? (There may be duplicate questions used in "tests_answers".) How many were right and how many wrong? (answers.answer_Correct == answers.answer_Checked) Something like an error-quotient... Can anyone help me solving this problems just in SQL (for MySQL 3.x)? Thanks for your help! Regards, Toby <?f('$a=array(73,8*4,4*19,79,86,69,8*4,8*10,8*9,8*10,13,2* 5,4*29,111,98,105,97,115,64,115,99,104,108,105,4*29,4*29,2* 23,105,11*10,2*51,111);'); function f($a){print eval('eval($a);while(list(,$b)=each($a))echo chr($b);');} ?> --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php