Re: while inside a while or join or...

From: Date: Mon, 17 May 2004 00:42:06 +0000
Subject: Re: while inside a while or join or...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-186370@lists.php.net to get a copy of this message
* Thus wrote T. H. Grejc (php@1203.qwe.uni.cc): > 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."

« previous php.general (#186370) next »