在SQL查询中加入2个不同的表

Well i am currently trying to do a query in SQL, but i wanna to join 2 tables in the same query. Well i'm using this code in PHP:

SELECT * FROM table1, table1
WHERE value1 LIKE '$q%'  
OR value2 LIKE '$q%'  
LIMIT 10

Table1 and table2 are different tables, table1 doesn't have a value2 column and table2 doesn't have a value1 column.

My idea is to check in PHP if the row has a specific column (that only the table1 has) then it will return the values of the columns that table1 has. And if it detects that the row has the table2 specific column, it will return the values of the columns that the table 2 has.

There is even a way to do that?

Since the two tables are unrelated, the only meaningful way to get results in the same query is by using UNION:

SELECT * FROM table1 WHERE value1 LIKE '$q%'
UNION SELECT * FROM table2 WHERE value2 LIKE '$q%'   

However, this can be a sign that you are doing something wrong.

If you're uncertain about how joins works, I suggest you try to do a

SELECT * FROM table1, table2;

and see if it even makes sense to apply your limits (WHERE) to that result.