[PHP-DB] mysql, php error

2005-03-07 Thread James
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).
[PHP Error 20050307145950]Backtrace:
[PHP Error 20050307145950]  0: connect (line 84 in 
/Library/WebServer/Documents/wda2-winestore/index.php)
[PHP Error 20050307145950]Variables in connect ():
[PHP Error 20050307145950]  GLOBALS is Array
[PHP Error 20050307145950]  _POST is NULL
[PHP Error 20050307145950]  _GET is NULL
[PHP Error 20050307145950]  _COOKIE is Array
[PHP Error 20050307145950]  _FILES is NULL
[PHP Error 20050307145950]  _PEAR_default_error_mode is 1
[PHP Error 20050307145950]  _PEAR_default_error_options is 1024
[PHP Error 20050307145950]  _PEAR_destructor_object_list is NULL
[PHP Error 20050307145950]  _PEAR_shutdown_funcs is NULL
[PHP Error 20050307145950]  _PEAR_error_handler_stack is NULL
[PHP Error 20050307145950]  hostname is 127.0.0.1
[PHP Error 20050307145950]  databasename is winestore
[PHP Error 20050307145950]  username is wineuser
[PHP Error 20050307145950]  password is w1nes
[PHP Error 20050307145950]  _SERVER is Array
[PHP Error 20050307145950]  dsn is 
mysql://wineuser:[EMAIL PROTECTED]/winestore
[PHP Error 20050307145950]  php_errormsg is var: Deprecated. Please use 
the public/private/protected modifiers
[PHP Error 20050307145950]  HTTP_SESSION_VARS is NULL
[PHP Error 20050307145950]  _SESSION is NULL
[PHP Error 20050307145950]  template is Object id #1

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


Re: [PHP-DB] mysql, php error

2005-03-07 Thread Martin Norland
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