FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PEAR DB: "PHP Fatal error: Call to undefined method DB::query()"
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PEAR DB: "PHP Fatal error: Call to undefined method DB::query()" [message #180208 is a reply to message #180207] Tue, 29 January 2013 09:19 Go to previous messageGo to previous message
Christoph Becker is currently offline  Christoph Becker
Messages: 91
Registered: June 2012
Karma:
Member
Robert S wrote:

> Can somebody tell me where I am going wrong? This all worked using
> my old code, but I got a lot of warnings about non static methods
> being called statically:

Apparently DB::connect() doesn't return an instance of the DB class. So
instead of

$dbh->connect( $dsn );

you have to call

$dbh = $dbh->connect( $dsn );

But probably it's better to stick with your old code, and declare static
methods as such in the DB class:

public static function connect($dsn) {...}

--
Christoph M. Becker
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: my blog
Next Topic: Formatting a number
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 22:12:08 GMT 2024

Total time taken to generate the page: 0.04706 seconds