I'm trying to echo info from a database onto the webpage. The page is supposed to have a bunch of article publications which includes the title, authors, journal name (if applicable), date published. For example:
- title of the article (with author 1, author 2, author 3), name of the journal, date published.
I've made two tables. One contains paper_id, author_id, paper_name, journal_name, date. Second one contains author_id, author_firstname, author_lastname.
The part I'm struggling with is outputting multiple authors. in the second table I have the following for first paper
author_id: 1
author_firstname: john
author_lastname: smith
author_id: 1
author_firstname: bob
author_lastname: thomas
I want to print this: Name of the paper (with john smith, bob thomas), journal name, date published.
I've tried joining author_id but it outputs the same paper twice (since i have two authors with id 1. I need suggestions as to how i should change the table or join it differently and what not. Any help will be appreciated, thanks. I'm also a beginner programmer