Re: oci8 error in DB.php
| From: | Mark | Date: | Wed, 21 Feb 2001 13:28:09 +0000 |
| Subject: | Re: oci8 error in DB.php | ||
| References: | 1 2 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-1401@lists.php.net to get a copy of this message | ||
Ok, thanks for your help, The undefined function message is gone, now I get:
DB Error: unknown error
the same message I got when I tried a similar thing earlier. It's not very
verbose in its error handling, could mean anything?
-Mark
quite strange if you ask me. At leasti
"Stig Sæther Bakken" <ssb@fast.no> wrote in message
news:m3itm5ghbe.fsf@kirin.trondheim.fast.no...
> ["Mark" <mfaine@bellsouth.net>]
> > I'm getting an error too, though it is different,
> >
> > Here it is:
> >
> > Fatal error: Call to undefined function: query() in functions.php on
line 70
> >
> > Here is the code that causes the error, what is wrong?
> >
> > function funcLogin($username, $password)
> > {
> > include './dbinfo.php';
> > require_once( 'DB.php' );
> >
> > if(!$username || !$password)
> > {
> > $feedback .= 'User Name and Password are both required';
> > return false;
> > }else{
> > $db = DB::connect( "oci8://$dbuser:$dbpass@$dbhost/$dbname");
> >
> > $sql = "SELECT * FROM rusers where username = '$username' AND
> > password='". md5($password) ."';
> >
> > if ( DB::isError( $doesUserExist = $db->query( $sql ) ) )
> > {
> > echo DB::errorMessage($doesUserExist);
> > }else{
> > // output results of query into $resultRow Array
> > // other code not related to problem at hand........
>
> You are not checking whether DB::connect() actually succeeds. If it
> doesn't, you'll get an error object back, and error objects have no
> "query" method. Add this after the DB::connect line:
>
> if (DB::isError($db)) {
> print $db->getMessage()."<BR>\n";
> return; // (or whatever)
> }
>
> - Stig
>
> --
> PHP Extension and Add-on Repository (PEAR) mailing list.
> Documentation can be found at http://pear.php.net/doc/pear.html
> To unsubscribe, e-mail: php-pear-unsubscribe@lists.php.net from the
> mail address you subscribed with.
>