Skip to content

Instantly share code, notes, and snippets.

@bytefade
Created July 10, 2014 16:22
Show Gist options
  • Save bytefade/f9f2e50dfe257361eac8 to your computer and use it in GitHub Desktop.
Save bytefade/f9f2e50dfe257361eac8 to your computer and use it in GitHub Desktop.
<?php
try {
/* TABELAS: rcsaude_codigo_regional, rcsaude_regional_plano,
rcsaude_tabela_plano, rcsaude_tabela_preco */
$q = $conn->query("SELECT *, tabp.tiulo AS tituloPlano
FROM rcsaude_codigo_regional cr
JOIN rcsaude_regional_plano rp ON cr.codigo=rp.id_codigo_regional
JOIN rcsaude_tabela_plano tp ON rp.id_plano=tp.id
JOIN rcsaude_tabela_preco tabp ON tp.id_preco=tabp.id
WHERE cr.uf='$uf' and id_operadora = '$operadora'
ORDER BY `tp`.`sequencia` ASC")->fetchAll();
if(!$q){
echo "Erro QBpreço : " . $conn->errorInfo();
}
return $q;
} catch (Exception $e) {
echo "Erro Bpreço: ".$e->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment