That code will work for the Oracle 8.0 but for Oracle 8i you'll want to use
the OCI funcitons
http://www.php.net/manual/en/ref.oci8.php
Using OCI is a little easier to understand then the ORA function (IMO).
You'll need to compile PHP with the --with-oci8 switch, and you'll need the
Oracle client libs installed.
- James
> -----Original Message-----
> From: Dunaway, Brian [mailto:[EMAIL PROTECTED]]
> Sent: June 26, 2001 7:25 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: [PHP] Oracle and PHP
>
>
> >I'm a newbie in PHP, what should I do to connect to Oracle Database.
> >Do I have to install a library to do that?
> >Please anyone, help.
>
> http://www.phpbuilder.com/manual/ref.oracle.php
>
> I usually do something similiar to this.
>
> (psuedo code follows):
>
> // Define Oracle_Home and Oracle_Sid
> putenv("ORACLE_HOME=/opt/ORACLE/product");
> putenv("ORACLE_SID=MYDATA");
>
>
> // Connect To Oracle Server/Else Return Error(s)
> if($connection = ora_logon(my-login,my-pass))
> {
> // Open Cursor
> $cursor = ora_open($connection);
>
> $query = "SELECT * FROM table ";
> $query .= "ORDER BY date1";
>
> // Parse Cursor
> ora_parse($cursor, $query);
>
> if ( ora_exec($cursor) )
> {
> $data = array();
> $field = array();
> while(ora_fetch_into($cursor, &$field))
> {
> reset ($field);
> $data[ $field[0] ] = $field[1];
> }
> }
> else
> {
> print("** While Attempting To Open Cursor On Query
> ** <br><br>\n\n");
> print("Oracle Returned The Following Error:
> <br>\n");
> print(ora_error($cursor));
> print("<br><br>\n\n");
> print("Oracle Error Code: ");
> print(ora_errorcode($cursor));
> }
>
> // Close Cursor
> Ora_Close($cursor);
>
> }
> else
> {
> print("** While Attempting To Open Connection ** <br><br>\n\n");
> print("Oracle Returned The Following Error: <br>\n");
> print(ora_error($connection));
> print("<br><br>\n\n");
> print("Oracle Error Code: ");
> print(ora_errorcode($connection));
> }
>
> // Disconnect
> Ora_Logoff($connection);
>
> --
> PHP General 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]
--
PHP General 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]