After installing phpbt 1.0rc5 and JpGraph 2.0beta on my
PHP5 server, I got the following error on phpbt main
page:
JpGraph Error General PHP error: Non-static method DB
::isError() should not be called statically
I fixed this by doing following changes:
/include.php, line 52, change
if (DB::isError($db)) {
to
if ($db->isError($db)) {
/upgrade.php, line 34, change
if (!$upgraded or DB::isError($thisvers)) {
to
if (!$upgraded or $db->isError($thisvers)) {
Seems to work for now.
Logged In: YES
user_id=592447
I think DB::isError is supposed to be static.
If you say that you know that phpBT is at fault and not your
version of Pear:Db I'll ask Benjamin to take a look at this.
As far as I see it your "$db->isError($db)" will not work
correctly. (there is no isError in class DB_Error. once you
have an error you will call a non-existing function)
Logged In: YES
user_id=701876
I don't know how it is programmed in the PHP5-Pear:Db as I
only have FTP access to my server - and only in my directory.
But I wanted phpBT to work and it works now.
I'd appreciate any better (and more working) bugfix.
Logged In: YES
user_id=1554333
I had the same problem.
It comes from PEAR:DB on Windows.
To fix it, I modified the file php\PEAR\pear\DB.php by
adding "static" before the functions "isError" and "connect".
There is nothing to change in phpBT.
Logged In: YES
user_id=304752
had the same Problem....
is this a PHP interpreter error, because there is no obvious
reason for this happening?
BTW kerfred´s solution seems the best, only a minor change
in the PEAR libs, changing all to instances in the phpbt
project is much more complicated.
regards, FL
Logged In: YES
user_id=1554333
It comes from PEAR:DB on Windows which is compatible with
PHP4 but not with PHP5. PHP5 needs the "static" keyword
before static methods and variables, whereas this keyword
does not exist in PHP4.
The solution is to add "static" before all static methods in
the file php\PEAR\pear\DB.php.
Logged In: YES
user_id=122507
Originator: NO
DB::isError is documented as static. Googling shows lots of people with this problem.
Try
------------------------
$db = new DB();
$db = $db->Connect($dsn);
if ($db->isError($db)) {
die($db->message.'<br>'.$db->userinfo);
}
-------------------------