0
I have 4 selects to do that I later put in the separate combobox only I want to put everything in one has like?
$sqlq = $pdo->prepare("SELECT * FROM tbl_tipo ORDER BY tipo ASC");
$sqlq ->execute();
$sqlqu = $pdo->prepare("SELECT cod_empresa,razao_social FROM tbl_empresa ORDER by razao_social ASC");
$sqlqu ->execute();
$sqlque = $pdo->prepare("SELECT * FROM tbl_pessoa_fisica ORDER BY nome ASC");
$sqlque ->execute();
$sqlquer = $pdo->prepare("SELECT cod_empregado,nome FROM tbl_empregado ORDER BY nome ASC");
$sqlque ->execute();
Kind of
$sqlquery = $pdo->prepare("SELECT tipo.*, empresa.*, pessoa.*, empregado.* FROM tbl_tipo tipo tbl_empresa empresa tbl_pessoafisica pessoa tbl_empregado empregado")
And then do that $linha->fetch(PDO::FETCH_ASSOC)
Dude, you’re gonna be looking for Ner Join, left Join, right Join and stuff like
– gabrielfalieri
You want a select for each table and you want it to return the data of all or you want to take specific data that has relation in the other table?
– Diéfani Favareto Piovezan
And when you spin
->execute()
, what will be returned? What if the amount of rows returned by eachselect
is not the same?– Wtrmute