> 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
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
>
> // 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
>
* 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
> -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
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
>
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
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
>
8 matches
Mail list logo