Page 1 of 1

[SOLVED] Oracle query HELP!

Posted: Fri Sep 03, 2004 10:20 am
by jamesloi
Hi,

Does anyone know how to chnage this code so that it uses the ORA functions instead of the OCI...

Code: Select all

<?php
$s = OCIParse($c, "SELECT * FROM ML_Account WHERE ACCOUNTNUM ='$account'"); 

OCIExecute($s, OCI_DEFAULT); 

while (OCIFetch($s)) { 

//Agent Name 
echo ". ociresult($s, "NAME") . "; 

}
?>
Thanks :D

Posted: Fri Sep 03, 2004 10:37 am
by Weirdan

Code: Select all

$query = "SELECT * FROM ML_Account WHERE ACCOUNTNUM ='$account'";
$conn = ora_logon('user', 'password');
$curs = ora_open($conn);
ora_parse($curs, $query);
ora_exec($curs);
while(ora_fetch_into($curs, $row, ORA_FETCHINTO_ASSOC)) {
    echo $row["NAME"];
}

Posted: Fri Sep 03, 2004 11:02 am
by jamesloi
Thanks dude i tried your code but i am getting these errors..

Code: Select all

Warning: ora_open(): supplied argument is not a valid Oracle-Connection resource in c:\inetpub\wwwroot\GLOBALCOM_FINAL\transactions.php on line 98

Warning: ora_parse(): supplied argument is not a valid Oracle-Cursor resource in c:\inetpub\wwwroot\GLOBALCOM_FINAL\transactions.php on line 99

Warning: ora_exec(): supplied argument is not a valid Oracle-Cursor resource in c:\inetpub\wwwroot\GLOBALCOM_FINAL\transactions.php on line 100

Warning: ora_fetch_into(): supplied argument is not a valid Oracle-Cursor resource in c:\inetpub\wwwroot\GLOBALCOM_FINAL\transactions.php on line 102
I have checked that my php can connect with oracle using a test script...help!

Posted: Fri Sep 03, 2004 11:12 am
by jamesloi
OK thanks dude i sorted it now...it was my fault.. i typed out the code incorrectly :D