Re: errors when try to acces a database

From: Date: Sat, 24 Sep 2011 21:44:50 +0000
Subject: Re: errors when try to acces a database
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-31237@lists.php.net to get a copy of this message
I'm not sure if you have to use pear:DB because of some other requirement, but it's been deprecated, ie retired, in favor of mdb2. But if you have to use DB then you can either adjust your error_reporting levels in your php.ini[1] or add something at the top of your files[2]. [1] http://us.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting [2] http://php.net/manual/en/function.error-reporting.php MS On Sat, Sep 24, 2011 at 6:54 AM, fragorino88 <fragorino88@libero.it> wrote: > > Hi everybody > > I'm using XAMPP on Ubuntu 10.10 and i installed PEAR. > > I just wanna to connect to my database so i write down example.php > > include ('db_login.php'); > require_once ('DB.php'); > $connection = DB::connect > ("mysql://$db_username:$db_password@$db_host/$db_database"); > if (DB::isError($connection)) { > die ("connection failed" .DB::errorMessage($connection)); > } > $connection->disconnect(); > > when i use the script a lot of errors displayed: > > Deprecated: Assigning the return value of new by reference is deprecated in > /opt/lampp/lib/php/DB.php on line 470 > > Deprecated: Assigning the return value of new by reference is deprecated in > /opt/lampp/lib/php/DB.php on line 547 > > Deprecated: Assigning the return value of new by reference is deprecated in > /opt/lampp/lib/php/DB.php on line 1124 > > Strict Standards: Non-static method DB::connect() should not be called > statically in /opt/lampp/htdocs/prove/select_pear (copy).php on line 6 > > Strict Standards: Non-static method DB::parseDSN() should not be called > statically in /opt/lampp/lib/php/DB.php on line 520 > > Strict Standards: Non-static method DB::isError() should not be called > statically in /opt/lampp/lib/php/DB.php on line 557 > > Strict Standards: Non-static method DB::isError() should not be called > statically in /opt/lampp/htdocs/prove/select_pear (copy).php on line 7 > > Any idea why > -- > View this message in context: > http://old.nabble.com/errors-when-try-to-acces-a-database-tp32503902p32503902.html > Sent from the Pear - General mailing list archive at Nabble.com. > > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- ----------------------------------------- Mark Steudel P: 425.298.7244 F: 206.260.3021 msteudel@gmail.com . : Work : . http://www.mindfulinteractive.com . : Play : . http://www.steudel.org/blog . : LinkedIn : . http://www.linkedin.com/in/steudel

« previous php.pear.general (#31237) next »