Sware Posted July 3, 2006 Share Posted July 3, 2006 I was doing fine and all of a sudden..Bam! Not unique table/alias: 'phpbb_posts'I'm new to MySQL and trying to create a portal with phpBB.$query = "SELECT phpbb_posts.poster_id, phpbb_users.username ". "FROM phpbb_posts, phpbb_users". "WHERE phpbb_posts.poster_id = phpbb_users.poster_id"; $result = mysql_query($query) or die(mysql_error());// Print out the contents of each row into a table while($row = mysql_fetch_array($result)){ echo $row['poster_id']; echo $row['username']; echo "<br />";}Just a little test but it shows that error, ANY help will be thanked for. Quote Link to comment Share on other sites More sharing options...
Sware Posted July 3, 2006 Author Share Posted July 3, 2006 Bump - Looked at once, not cool. Quote Link to comment Share on other sites More sharing options...
fenway Posted July 3, 2006 Share Posted July 3, 2006 That is an unusual error... do you get the same error when you convert that query to proper join syntax? Quote Link to comment Share on other sites More sharing options...
Sware Posted July 3, 2006 Author Share Posted July 3, 2006 $query = "SELECT phpbb_posts.poster_id, phpbb_users.username FROM phpbb_posts, phpbb_users WHERE phpbb_posts.poster_id = phpbb_users.poster_id"; something like that? yes. Quote Link to comment Share on other sites More sharing options...
fenway Posted July 3, 2006 Share Posted July 3, 2006 No, something like:[code]SELECT phpbb_posts.poster_id, phpbb_users.username FROM phpbb_posts JOIN phpbb_users ON phpbb_posts.poster_id = phpbb_users.poster_id[/code] Quote Link to comment Share on other sites More sharing options...
Sware Posted July 3, 2006 Author Share Posted July 3, 2006 How do I add another join onto that[code]SELECT phpbb_posts.poster_id, phpbb_users.username FROM phpbb_posts JOIN phpbb_users ON phpbb_posts.poster_id = phpbb_users.poster_id (+ ANOTHER JOIN)[/code]or can you not do that? Quote Link to comment Share on other sites More sharing options...
fenway Posted July 3, 2006 Share Posted July 3, 2006 Simply add another JOIN newTable ON ( condition). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.