Oracle+PHP

1 view
Skip to first unread message

Diego Telles

unread,
Oct 1, 2014, 10:45:11 AM10/1/14
to php...@yahoogrupos.com.br, php-espe...@yahoogrupos.com.br, ph...@googlegroups.com, phpri...@googlegroups.com, php-my...@googlegroups.com
Bom dia!

             Srs;

             Help pra leigo em oracle + php, tenho o seguinte script:

    
$stid = oci_parse($conexao, "SELECT A_US_PERFORMED_PROCEDURES.PROCEDURE_KEY,
A_US_PERFORMED_PROCEDURES.APPOINTMENT_DATE,
     A_US_PERFORMED_PROCEDURES.PROCEDURE_NAME,
         A_US_PATIENT.PAT_FIRST_NAME,
          A_US_PATIENT.PAT_LAST_NAME,
A_US_PATIENT.PAT_PID_NUMBER,
          A_US_PATIENT.PAT_BIRTH_DATE
FROM MEDORA.A_US_ACC_CASE_OTHER_FIELDS A_US_ACC_CASE_OTHER_FIELDS,
 MEDORA.A_US_BD_PROCEDURE A_US_BD_PROCEDURE,
  MEDORA.A_US_PATIENT A_US_PATIENT,
   MEDORA.A_US_PATIENT_OTHER_FIELDS A_US_PATIENT_OTHER_FIELDS,
    MEDORA.A_US_PERFORMED_PROCEDURES A_US_PERFORMED_PROCEDURES
WHERE A_US_PATIENT.PATIENT_KEY = A_US_PATIENT_OTHER_FIELDS.PATIENT_KEY AND
 A_US_PATIENT_OTHER_FIELDS.PATIENT_KEY = A_US_PERFORMED_PROCEDURES.PATIENT_KEY AND
  A_US_PERFORMED_PROCEDURES.CASE_KEY = A_US_ACC_CASE_OTHER_FIELDS.CASE_KEY AND
   A_US_PERFORMED_PROCEDURES.PROCEDURE_CODE = A_US_BD_PROCEDURE.PROCEDURE_CODE AND
    ((to_char(PROCEDURE_START,'yyyy.mm.dd') Between '2014.09.01' And '2014.09.05' ))
ORDER BY A_US_PERFORMED_PROCEDURES.PROCEDURE_START");

oci_execute($stid);

echo "<table border='1'>\n";

while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {

echo "<tr>\n";

foreach ($row as $item) {

echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES)
: " ") . "</td>\n";


}

echo "</tr>\n";

}

echo "</table>\n";
   
  
  
  
   //echo "Conexão bem sucedida.";
   }
   else
 {
 echo "Erro na conexão com o Oracle.";
 }
?>

E gostaria de pegar cada campo e colocar numa variável pra que eu pudesse trabalhar com esses dados ao invés de printá-los diretamente na tela.

No mysql por exemplo eu faria assim: $campo nome = $row[nome do campo]


Diego Teles
Analista de Sistemas Pleno / Desenvolvedor WEB e Mobile
Cel.: (21) 991268311

 

Reply all
Reply to author
Forward
0 new messages