* Thus wrote T. H. Grejc ([EMAIL PROTECTED]):
> 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:
>
> ...
>
> 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.
I'm having difficluties finding out how this is related to php, but
anyway... this is a simple joining of two tables.
so you have
select b from table_1 where a = 2
and
select d from table_2 where b = results from table_1
Thus
select table_1.b, table_2.d from table_1, table_2
where table_1.b = table_2.b
and table_1.a = 2
come to think of it, thats very much like an algebra problem.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php