Hello !

> Hello: My name is Mike and I have little problem.How can I get a
connection
> to an ORACLE8i-database with php4?
> I can't find any documentation about it.

If you've a distant database you mut install Oracle client on your PHP
serveur.

For the connection the best solution is to use OCI fonctions, here is a
sample :

// You can find the connection string in the file tnsnames.ora, this is the
only solution i've find to connect to my distant database
$Connection="(DESCRIPTION = (ADDRESS = (PROTOCOL = ...)(HOST = ...)(PORT =
...))(CONNECT_DATA = (SID = ...)))";
// under Windows NT this file is under [Oracle
Client]\Net80\Admin\Tnsnames.ora

// This is a permanent connection
$Oracle=OCIPLogon(user, passowrd, $Connection);

// sample of query
$Requete=OCIParse($Oracle, "select ALTI from POSTE order by COMMUNE");

// the ALTI field is store in the $Alti variable
OCIDefineByName($Requete,"ALTI",&$Alti);

// execute the query
OCIExecute($Requete);

// read all the rows
while (OCIFetch($Requete))
{
     echo $Alti
}

Don't forget the line
extention=php_oci8.dll in your PHP.ini if you work under Windows NT, with
LINUX you must make your PHP with the OCI8 librairie i think...

If you've other questions... i've tested PHP 4.04 with IIS 4, NT 4 and
Oracle 8 client with a database installed on a HP system, it works very well
!

Good luck

Jean-Christophe Le Brun
Météo-France
CMIRNE/DET
03-88-40-42-46
[EMAIL PROTECTED]


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to