$sql = 'SELECT name FROM table WHERE condition; SELECT name FROM another table WHERE same condition;
table
another table
I'm not sure if it would work (not return an error), but it would be pointless as you would be unable to access the first result set.
Use two separate queries.
I am not sure if this will produce the results that you want but this is how I would simplify your query.
SELECT name FROM table, another table WHERE condition
k0ma
That wouldn't work because 'name' would be ambiguous. You could use something like this -
SELECT a.name, b.name FROM table a, another_table b WHERE condition for a AND condition for b
Would that work on MySQL?