@PhilipToop: please don't use SELECT *, but rather select all the fields you want to have; SELECT field1, field2, field3, etc .
@ScallioXTX: Just keeping the original syntax of @D3V4.
First option: let's say that I have to fields in the first table that are joined with the same field on the second table:
Are you talking about a scenario such as
table1 with fields, id, title, keyid1, keyid2
table2 with fields id, name
keyid1 and keyid2 both refer to an entry in table2
Using a form of my second sql statement
SELECT t1.id, t1.title, t2.name name1, t2a.name name2
FROM table1 t1
JOIN table2 t2 ON t2.field1 = t1.keyid1
JOIN table2 t2a AND t2a.field2 = t1.keyid2
In your PHP code you would access $row['name1'] and $row['name2']