Selecting data from two tables at the same time

Can i select data from two tables with a single sql sentence and use fetch_assoc and while loop to print the mixed data coming from two tables?
Who is Participating?
Evan CutlerConnect With a Mentor Volunteer Chief Information OfficerCommented:
yes.  but using the asterik(*) provides an issue of names identical in both tables.
in order to fetch across the resulting dataset, you will be sucked into a fully qualified column name (ie. networking.column1 and member.column1).  you might want to qualify those names first (ie. netcol1 and memcol1) and use individual columns names instead of the asterik(*).
Evan CutlerVolunteer Chief Information OfficerCommented:
can you please put in code you have already worked on?  This may become easier to answer if we know what we are dealing with.  Thanks.
BraveheartliMarketingAuthor Commented:
I'm out of office right now, however what i want to learn is : can i select data like this and print it out with fetch function and while loop?

SELECT * FROM member
LEFT JOIN networking
ON member.networkingID=networking.ID
WHERE member.ID=2
BraveheartliMarketingAuthor Commented:
Thank you
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.