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

From: Date: Mon, 17 May 2004 00:37: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-186369@lists.php.net to get a copy of this message
> > 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). > If I understand you correctly, its sounds like you want to do the following: $sql = " SELECT t1.b, t2.d FROM Table_1 AS t1 LEFT JOIN Table_2 AS t2 ON (t1.b = t2.d) WHERE t1.a = '2'"; ===== ~Rachel __________________________________ Do you Yahoo!? SBC Yahoo! - Internet access at a great low price. http://promo.yahoo.com/sbc/

« previous php.general (#186369) next »