Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Mysql JOIN bug?

10:16 pm on Feb 15, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:May 16, 2009
votes: 0

$query = "SELECT * FROM articles
INNER JOIN sections ON articles.section_id = sections.id_section
INNER JOIN authors ON articles.author_id = authors.id_author
INNER JOIN releases ON articles.id_release_n = releases.release_n
LEFT JOIN comments ON articles.id_article = comments.id_article_com"

the comments table has temporarily 5 rows for testing, when I do a mysql_fetch_array on the query the first row of the comments table is skipped, is this a bug?
Of course id_article_com is for all 5 rows the same.
The only solution was to make another query which gives all the rows.
10:39 pm on Feb 18, 2010 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 9, 2003
votes: 0

Could you post the snippet of code where you output the result of mysql_fetch_array?
5:34 pm on Feb 20, 2010 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 12, 2004
votes: 0

Does the first comment record have a matching releases record? If not, you will not see the row.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members