Re: Join statement and output

From: Date: Sun, 04 Mar 2001 16:54:52 +0000
Subject: Re: Join statement and output
Groups: php.db 
Request: Send a blank email to php-db+get-7108@lists.php.net to get a copy of this message
Norman, The SQL statement is this: select s.first_name AS s_name, t.first_name AS t_name, f.date from members s, members t, schedule f where s.first_name=f.member1 and t.first_name=f.member2 The AS is optional but it works the same as aliasing table names in the FROM clause. $s_name | $t_name | date Dan __________________________________ Subject: Join statement and output Date: Sat, 03 Mar 2001 22:43:27 -0800 From: Norman Tan <norman@nsmb.com> To: php-db@lists.php.net No actual code, but hopefully, someone can help me through the theory here. I have 2 tables: members - first_name, last_name schedule - member1, member2, date The SQL statement is this: select s.first_name, t.first_name, f.date from members s, members t, schedule f where s.first_name=f.member1 and t.first_name=f.member2 Now the output would look something like this. | first_name | first_name | date | Question is, in PHP, how would I distinguish the two first_name fields? Database is currenly MySQL, but I would like this to be database independant. Thanks for your help. -- Norman Tan North Shore Interactive http://www.nsmb.com

« previous php.db (#7108) next »