Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Problem with PHP and PL/SQL

$
0
0
Good night, I need some help with my code because i cant get the output from the sql funcion to the table, i´ve looking in the php manual for solutions but i cant resolve this problem
<?php

  $stmt = oci_parse ($conn, "begin PQUESTOES.P12(:Q_FOR_NIF,:Q_For_Nome, :Q_For_Morada, :Q_For_Localidade, :Q_For_CodigoPostal, :Q_For_Telefone, :Q_For_Fax, :Q_For_Email, :Q_For_Telemovel,:error,:errorMsg); end;");
  oci_bind_by_name($stmt,":Q_For_NIF",$_REQUEST["q_for_nif"]);
  oci_bind_by_name($stmt,":Q_For_Nome",$q_for_nome,512);
  oci_bind_by_name($stmt,":Q_For_Morada",$q_for_morada,512);
  oci_bind_by_name($stmt,":Q_For_Localidade",$p_for_localidade,512);
  oci_bind_by_name($stmt,":Q_For_CodigoPostal",$p_for_codigopostal,512);
  oci_bind_by_name($stmt,":Q_For_Telefone",$p_for_telefone,512);
  oci_bind_by_name($stmt,":Q_For_Fax",$p_for_fax,512);
  oci_bind_by_name($stmt,":Q_For_Email",$p_for_email,512);
  oci_bind_by_name($stmt,":Q_For_Telemovel",$p_for_telemovel,512);
  oci_bind_by_name($stmt,":error",$error,3);
  oci_bind_by_name($stmt,":errorMsg",$errorMsg,512);
  oci_execute($stmt);
  
  if ($error != 0) {
    echo "<h2 class=\"erro\">Erro: $errorMsg</h2>";
  }
  else {
        echo "
<table> 
<tr>
<th>For_Nome</th>
<th>For_Morada</th>
<th>For_Localidade</th>
<th>For_CodigoPostal</th>
<th>For_Telefone</th>
<th>For_Fax</th>
<th>For_Email</th>
<th>For_Telemovel</th>
</tr>";

echo "
<tr>
<td>$q_for_nome->FOR_NOME</td>
<td>$q_for_morada->FOR_MORADA</td>
<td>$p_for_localidade->FOR_LOCALIDADE</td>
<td>$p_for_codigopostal->FOR_CODIGOPOSTAL</td>
<td>$p_for_telefone->FOR_TELEFONE</td>
<td>$p_for_fax->FOR_FAX</td>
<td>$p_for_email->FOR_EMAIL</td>
<td>$p_for_telemovel->FOR_TELEMOVEL</td>
</tr>";

echo 
"</table>";
  }
  oci_free_statement($stmt);

  oci_close($conn);
  
?>


any help is welcome

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>