First, you need to make sure that you have ORACLE_HOME and ORACLE_SID set. If they arent' you can set them manually in your script by using the putenv() function. Next, to connect:
if(!$c = ora_logon("username","password") {
die("Could not logon"
}
if(!$curs = ora_open($c)) {
die("Could not open Cursor"
}
$q = "SELECT * FROM my_table";
if(!ora_parse($curs,$q)) {
die("could not parse query"
}
if(!ora_exec($curs)) {
die("Could not execute query"
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.