Re: mysql, php error
| From: | Martin Norland | Date: | Mon, 07 Mar 2005 20:26:40 +0000 |
| Subject: | Re: mysql, php error | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-38806@lists.php.net to get a copy of this message | ||
James wrote:
I'm pretty new to this...I've set this book example up on my PC and it's fine. I've attempted this on two Macs... Here's the error I get when I try to run the application. What does the error mean? UNHANDLED ERROR on line 84 in /Library/WebServer/Documents/wda2-winestore/index.php. [PHP Error 20050307145950]Error: "Non-static method DB::connect() should not be called statically" (error #2048). [snip]You're calling a classes method statically when it cannot be called as such - the function makes references to $this, or has otherwise been shown to be non-static. You need to create an instance of the object, then call the method through it. E.G. instead of: DB::connect('some','variables'); you have to use: $mydb = new DB; $mydb->connect('some','variables'); Without the exact code, I can only give you examples of about how it should look - but that's the gist of it. cheers, -- - Martin Norland, Sys Admin / Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital.