Jump to content
Sign in to follow this  
asacap1000

Caixa de seleção com dados vindo do banco Oracle

Recommended Posts

Galera estou com uma página que tem a seguinte informação.

<select name="cnpj" required="required" id="cnpj"  size="1">
<option value="">Selecione um Cliente</option> <?php 
$conn = oci_connect("user","pass","banco");  
$stmt = ociparse($connect,"select DISTINCT k.SUCHBEGRIFF from desmembr d, klienten k, dispatcher t  where d.id_klient = k.id_klient    AND d.lager = t.lager(+) AND d.id_dispatcher = t.id_dispatcher(+) AND d.typ_process = 'DINACI' and t.suchbegriff = '00883968000103'");
oci_execute($stmt,OCI_DEFAULT);
 while ($row = oci_fetch($stmt, OCI_NUM)) { echo "<option value='". oci_result($stmt,1) ."</option>"; }?></option>
</select>
 <input type="submit" name="buscar2" required="required" id="buscar2" value="SELECIONAR" /> 
</form>

Não sei no que estou errando pois não retorna nenhuma informação na caixa, Já testei este select no PL e rodou normalmente.

Share this post


Link to post
Share on other sites

Electronic showwww valewww,

Olha com ficoou agora 100%

 <select name="cnpj" required="required" id="cnpj"  size="1">
<option value="">Selecione um Cliente</option> <?php 
$connect = oci_connect("user","pass","banco");  
$stmt = ociparse($connect,"select DISTINCT k.SUCHBEGRIFF from desmembr d, klienten k, dispatcher t  where d.id_klient = k.id_klient    AND d.lager = t.lager(+) AND d.id_dispatcher = t.id_dispatcher(+) AND d.typ_process = 'DINACI' and t.suchbegriff = '$_SESSION[sobrenome]'");
oci_execute($stmt,OCI_DEFAULT);   
 while (oci_fetch($stmt)) {
	 echo("<option value='". oci_result($stmt,1) ."'>". oci_result($stmt,1) ."</option>");}?>
</select>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.