Select all data from few tables, how to?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Amzul
    New Member
    • Oct 2007
    • 130

    Select all data from few tables, how to?

    hello all,

    i am useing mysql
    and i wonder how i can select all data from 3 diff tables and show it in one table
    useing php

    the primerry key in each table is the same

    Code:
    select * from table1,table2,table3 gives me each table 3 times,
    i want only to show full data of one row each time
    Code:
    SELECT * FROM t1,t2,t3 WHERE t1.id = my_id
    and it will give me the data from all tables
    hope i am being clear
    thanks
  • coolsti
    Contributor
    • Mar 2008
    • 310

    #2
    Your problem would be much clearer, and easier for others to help you, if you provide the structure of all three tables.

    Otherwise, I suggest you read some documentation on how tables are joined in MySQL and in databases in general.

    Comment

    Working...