|
|
|
It's not even that easy, you need to set up a few environment variables
as well. Here's what typically works for me, customize things to
fit your installation.
PutEnv("ORACLE_HOME=/export/home0/oracle7");
PutEnv("ORACLE_SID=<some db name here>");
PutEnv("ORA_NLS=/export/home0/oracle7/ocommon/nls/admin/data");
$conn_id = ora_plogon("<username>","<password>");
$cur = ora_open($conn_id);
ora_parse($cur, "SELECT * from session WHERE sessionid = '9087652'");
ora_exec($cur);
while (ora_fetch($cur) == 1) {
$sessionid = ora_getcolumn($cur, 0);
$username = ora_getcolumn($cur, 1);
$firstname = ora_getcolumn($cur, 2);
$lastname = ora_getcolumn($cur, 3);
$phone = ora_getcolumn($cur, 4);
...
}
I haven't done much with Oracle in PHP3 so there are probably spiffier
ways for fetching the columns and rows, but this should get you started
at least.
> How will PHP/Oracle deal with the fact that the columns firstname &
> lastname are null?
>
Null columns come into PHP as empty strings ( "" ) I believe.
|
|
| Ora_Bind -- bind a PHP variable to an Oracle parameter Categories : PHP, PHP Functions, Oracle | | | normalize fields and strings used in where (command's Sql) Categories : PHP, Databases, Oracle, Functions | | | StoredProcedure, Stored Procedure, Oracle, OCI8, OCI8i Categories : OCI8, Oracle, Databases, PHP | | | Ora_CommitOn Ora_CommitOff commit rollback database SQL Oracle Categories : Oracle, PHP | | | Connecting to Oracle with php3 Categories : Oracle, PHP, Databases | | | Simple class for accessing databases like MSSql Server, Oracle etc by Raju Categories : PHP, MS SQL Server, Databases, PHP Classes, Oracle | | | Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP, PHP, HTML, PDF, Excel | | | PHP CLASS for ORACLE (database connectivity) Categories : PHP, PHP Classes, Classes and Objects, Databases, Oracle | | | A database abstraction layer for the PHP Oracle 8 module (available from PHP 3.0.5). It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface. Categories : Databases, Oracle, PHP, Arrays, Variables | | | Retrieve text from table and email to your e-
address in pipe delimited format. Categories : PHP, MySQL | | | Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs. Categories : Databases, PHP, MySQL, Complete Programs | | | PHP Script to find url links in a page Categories : PHP, URLs, Regexps, Arrays | | | Using $PHP_AUTH_USER and $PHP_AUTH_PW to authenticate. Categories : Authentication, PHP | | | very simple ftp class Categories : PHP, PHP Classes, FTP | | | PHP Paypal IPN Integration Class v1.0.0 Categories : PHP, PHP Classes, Payment Gateways | |
|
|
|