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)

5+ Year Member

$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)

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

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)

10+ Year Member

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

Featured Threads

Hot Threads This Week

Hot Threads This Month