hi all experts here, i am currently doing my web project using PHP and facing no clue for the database connection between 3 tables....here it is:

i'd created 3 tables, one keeps users' username, password, and id....the other keeps the details that user input from a form...both contain a common username. How can i connect both the table and retrieve (SELECT * from ...... ) the whole row of data for the same username? thanks...

Recommended Answers

All 3 Replies

You need a primary key (sometimes secondary key is usefull but your DB is small so no need) by which you can assosiate data between tables. So if your user table has an UNIQUE ID you should use that in other tables and this way you can link the data between them

To clarify, you need to use JOIN to get data from all 3 tables.

I do not think he wants to join 3 tables together, I believe eparse wants to associate data from each table

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.