Re: Re: Oracle 8i problem
| From: | Justin Patrin | Date: | Fri, 30 Jul 2004 21:13:27 +0000 |
| Subject: | Re: Re: Oracle 8i problem | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13920@lists.php.net to get a copy of this message | ||
On Fri, 30 Jul 2004 13:56:10 -0700, Moffet, Scott <smoffet@linkpoint.com> wrote:
> Justin
>
> PLease pardon my intrusion, I'm a desperate man... :)
No intrusion at all.
>
> Thanks for your prompt answer. Thanks for your help.
>
> Because I'm a PHP/PEAR newbie, I'm not quite sure how to go about
> calling your subclass.
> Please please please tell me what I'm doing wrong here, or provide a
> snippet of sample code demonstrating how to use the code you sent?
>
> I'm getting the error:
> "Fatal error: Call to undefined function: raiseerror() in
> /usr/local/lib/php/DB/oci8.php on line 132"
>
> but maybe I'm calling it incorrectly? (I'm a poor newbie :)
>
> Here's what I'm trying: what am I doing wrong???
> ___________________________________________
>
> <?php
> require_once ('DB.php'); // Do I need this too?
> require_once('DB/oci8.php');
>
> class DB_oci8ext extends DB_oci8 {
> function connect($dsninfo, $persistent = false) {
> if($dsninfo['hostspec'] || $dsninfo['database'] ||
> $dsninfo['port']) {
> $dsninfo['hostspec'] = '(DESCRIPTION=
> (ADDRESS_LIST=
> (ADDRESS=
> (COMMUNITY = tcp_comm.world)
> (PROTOCOL = TCP)
> (Host = '.$dsninfo['hostspec'].')
> (Port = '.($dsninfo['port'] ? $dsninfo['port'] :
> '1521').')
> )
> )
> (CONNECT_DATA =
> (SID = '.$dsninfo['database'].')
> (GLOBAL_NAME = '.$dsninfo['database'].'.world)
> )
> )';
> }
> return DB_oci8::connect($dsninfo, $persistent);
> }
> }
>
> $dsninfo['hostspec'] = "192.168.40.33";
> $dsninfo['database'] = "CLEAR";
> $dsninfo['port'] = "1521"; //OPTIONAL?
>
> $db = DB_oci8ext::connect ($dsn); // am I doing this
> right???
>
> ;
> ;
> ;
>
> ?>
>
Take the code I gave you and put it in oci8ext.php. Put that in the DB
folder (where oci8.php is). Use it like this:
require_once('DB.php');
$db = DB::connect('oci8ext://abc:xyz@192.168.40.33/CLEAR'');
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--