Hi.
I have two tables with the following structure:
Users:
+--------------+------------------+------+-----+---------+--------------
--+
| Field | Type | Null | Key | Default | Extra
|
+--------------+------------------+------+-----+---------+--------------
--+
| id | int(10) unsigned | | PRI | NULL |
auto_increment |
| name | blob | YES | | NULL |
|
| firstname | blob | YES | | NULL |
|
| email | blob | YES | MUL | NULL |
|
| password | blob | YES | | NULL |
|
| activated | set('yes','no') | YES | | NULL |
|
| plz | varchar(10) | YES | | NULL |
|
| city | blob | YES | | NULL |
|
| street | blob | YES | | NULL |
|
| country | blob | YES | | NULL |
|
| dateofbirth | date | YES | | NULL |
|
| mobile | blob | YES | | NULL |
|
| sms | set('yes','no') | YES | | NULL |
|
| creationdate | datetime | YES | | NULL |
|
+--------------+------------------+------+-----+---------+--------------
--+
answers:
+----------+---------------------+------+-----+---------+---------------
-+
| Field | Type | Null | Key | Default | Extra
|
+----------+---------------------+------+-----+---------+---------------
-+
| id | int(10) unsigned | | UNI | NULL | auto_increment
|
| userid | int(10) unsigned | | PRI | 0 |
|
| question | int(10) unsigned | | PRI | 0 |
|
| correct | set('true','false') | YES | | NULL |
|
| date | date | YES | | NULL |
|
+----------+---------------------+------+-----+---------+---------------
-+
This is for a quiz. Every user has to answer 4 questions that will be
stored in the answers table. After the game there exist 4 rows for each
user in the answers table. The field correct is set 'true' if the user
has given the correct answer. Now, I want to print out all users, that
have answered all 4 questions correct.
Can I do this with one query?
Thanks for helping me,
Richard
---------------------------------------------------------------------
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