jasom 0 Posted June 4, 2015 Report Share Posted June 4, 2015 (edited) Hi guys, I'm new in PHP. I cannot find tutorial about how to get all categories article is listed in together with article title, author printed on the article list. I have 4 tables in DB: articles = DB for articles detailse: id, title, user_id, post_date articles_categories = id, category_id categories = category_id, category_name users = user_id, user_name, user_mail I want to do this: Which script logic do you suggest? Any kind of help is welcomed. Edited June 4, 2015 by jasom Quote Link to post Share on other sites
justsomeguy 1,135 Posted June 4, 2015 Report Share Posted June 4, 2015 You need to use a join, but the result will contain 1 record per category. You'll need to loop through them to build the list of categories. Quote Link to post Share on other sites
jasom 0 Posted June 6, 2015 Author Report Share Posted June 6, 2015 Thank you for your hint. Quote Link to post Share on other sites
dauruk0512 10 Posted June 10, 2015 Report Share Posted June 10, 2015 wait minute how can you join that's table even each table there is no same field to join it, do i wrong this issue? Quote Link to post Share on other sites
jasom 0 Posted June 10, 2015 Author Report Share Posted June 10, 2015 wait minute how can you join that's table even each table there is no same field to join it, do i wrong this issue? You can do INNER JOIN but it will results with duplicated rows. Sollution will consist from some kind of PHP hack. Quote Link to post Share on other sites
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.