$query1 = "SELECT id, ac, aa FROM tbl_ac WHERE ac = ? AND aa = ?";
and
$query2 = "SELECT id, cc FROM tbl_cc WHERE cc = ?";
What is the best equivalent of those two query in just one query? I can’t use INNER JOIN with this because each table doesn’t have any relations.
I just want to verify if ac, aa and cc exists in my database.
If you want one query for this you can do it like this:
but I don’t recomend.
If the queries are not linked in any way, you should do the two queries.