How to extract data from multiple MySQL tables with the same ID

advertisements

I am needing to know how to query data from multiple tables in MySQL with same ID, so with example below I want to echo

Tom Smith
Cell: 9999999999
Email: [email protected]

Table 1: id: 1 first_name: Tom last_name: Smith

Table 2: id: 1 phone_number: 9999999999 type: cell

Table 3: id: 1 email: [email protected]


SELECT t1.first_name, t1.last_name, t2.phone_number, t2.type, t3.email FROM firsttable t1, secondtable t2, thirdtable t3 WHERE t1.id = t2.id && t2.id = t3.id

This will give you all information in one row.