> 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 confused about is: > ............... > select ft.topic_id, ft.topic_title from forum_posts > ................ > > It seem that the alias of ft refers to forum_title - not forum_posts.
ft refers to forum_topics "forum_topics as ft " > > In fact, I switched the query to read as follows: > ................ > $verify = "select ft.topic_id, ft.topic_title from forum_topics as ft left > join forum_posts as fp on fp.topic_id = ft.topic_id where fp.post_id = > $_GET[post_id]"; > .................. > > And that seems to run fine. > > Any explanations will be appreciated. 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php