while inside a while or join or...
| From: | T. H. Grejc | Date: | Mon, 17 May 2004 00:29:57 +0000 |
| Subject: | while inside a while or join or... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-186368@lists.php.net to get a copy of this message | ||
Hallo,
I know of a few ways of doing this but I am not sure that any is right. I want to consult with you what is the best way of doing this:
Table 1:
+----+-----+
| *a* | *b* |
+----+-----+
| 2 | 1 |+----+-----+
| 2 | 2 |+----+-----+ Table 2: +----+-----+ | *b* | *d* | +----+-----+ | 1 | asd | +----+-----+ | 2 | fgh | +----+-----+ I would like to select all 'b' from Table_1 WHERE a = '2' and then to select all 'd' from table_2 with 'b' from previous result. Table 2 is the Table with UserNames (d) and Table 1 is the table with 'marked' UserID's (b). What is the best way of doing this. TNX