$catalog = $dbh->prepare("SELECT * FROM catalogo WHERE ativo = 2 ORDER BY catalogo_view DESC LIMIT 0,5");
$catalog->execute();
I want to search between two tables, how do I?
$catalog = $dbh->prepare("SELECT * FROM catalogo WHERE ativo = 2 ORDER BY catalogo_view DESC LIMIT 0,5");
$catalog->execute();
I want to search between two tables, how do I?
Try to use UNION, but remembering that in UNION the query columns must have the same amount.
SELECT cliente_codigo, cliente_nome FROM cliente
UNION SELECT funcionario_codigo, funcionario_nome FROM funcionario
WHERE ativo = 2