RE: [PHP] discussion forum from j. meloni's book

2003-08-14 Thread Jennifer Goodie
> Anyway, in the textbook and the zip her mySQL query reads: > ... > $verify = "select ft.topic_id, ft.topic_title from forum_posts as fp left > join forum_topics as ft on fp.topic_id = ft.topic_id where fp.post_id = > $_GET[post_id]"; > . > > The part that I'm confu

Re: [PHP] discussion forum from j. meloni's book

2003-08-14 Thread Anthony Ritter
Jennifer Goodie" <[EMAIL PROTECTED]> writes: > You didn't switch the aliases around, you just switched the join order. > This will provide unexpected results. In order to understand it, you should > read up on left joins. > http://www.mysql.com/doc/en/JOIN.html Thank

RE: [PHP] discussion forum from j. meloni's book

2003-08-14 Thread Jennifer Goodie
> > // the query > > $verify = "select ft.topic_id, ft.topic_title from forum_posts as fp left > join forum_topics as ft on fp.topic_id = ft.topic_id where fp.post_id = > $_GET[post_id]"; > ... > > My question: why - or how can - the columns ft.topic_id and ft.topic_title >

Re: [PHP] discussion forum from j. meloni's book

2003-08-14 Thread Curt Zirzow
* Thus wrote Anthony Ritter ([EMAIL PROTECTED]): > Jennifer Goodie" <[EMAIL PROTECTED]> writes: > > > You didn't switch the aliases around, you just switched the join order. > > This will provide unexpected results. In order to understand it, you > should > > read up on left joins. > > http://www

RE: [PHP] discussion forum from j. meloni's book

2003-08-14 Thread Ford, Mike [LSS]
> -Original Message- > From: Anthony Ritter [mailto:[EMAIL PROTECTED] > Sent: 13 August 2003 02:57 > > Jennifer Goodie" <[EMAIL PROTECTED]> writes: > > > You didn't switch the aliases around, you just switched the > join order. > > This will provide unexpected results. In order to > un

Re: [PHP] discussion forum from j. meloni's book

2003-08-14 Thread Anthony Ritter
Ford, Mike [LSS]" <[EMAIL PROTECTED]> writes: > You have a conceptual misconception. In effect, you need to read that query > as: > > "select ft.topic_id, ft.topic_title > from ( forum_posts as fp > left join forum_topics as ft > on fp.topic_id = ft.topic_id >

Re: [PHP] discussion forum from j. meloni's book

2003-08-14 Thread Anthony Ritter
Jennifer Goodie" <[EMAIL PROTECTED]> writes: They don't. ft is aliased to forum_topics. That's right. ft is aliased to the forum_topics table. The query reads: ... $verify = "select ft.topic_id, ft.topic_title from forum_posts as fp left join forum_topics as ft

Re: [PHP] discussion forum from j. meloni's book

2003-08-14 Thread Anthony Ritter
Ford, Mike [LSS]" <[EMAIL PROTECTED]> writes: > You have a conceptual misconception. In effect, you need to read that query > as: > > "select ft.topic_id, ft.topic_title > from ( forum_posts as fp > left join forum_topics as ft > on fp.topic_id = ft.topic_id >