in old time for select data from two or more tables i use this way: for example
SELECT id,name FROM table WHERE ...
// and after get data, use second request
SELECT title FROM table_two WHERE id=$ID
// and here, id come from first query
after a while i found out this way:
SELECT t1.id,t1.name,t2.title FROM table as t1,table_two as t2 WHERE ... AND t1.id=t2.id
then in one query i get all data i want from both tables or even more (e.g. fetch data from 4 tables)
but i wondering is this a good way to get data or not? should i use JOIN in my query? can you give me an example of JOIN for this one:
SELECT t1.id,t1.name,t2.title FROM table as t1,table_two as t2 WHERE ... AND t1.id=t2.id
is this way make any problems for large DB?