Re: mysql, php error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux