Saturday, 7 September 2013

Strict Standards: Non-static method DB::errorMessage()....in XAMPP's localhost

Strict Standards: Non-static method DB::errorMessage()....in XAMPP's
localhost

The full error is this:
Strict Standards: Non-static method DB::errorMessage() should not be
called statically, assuming $this from incompatible context in
C:\xampp\php\pear\DB.php on line 965
I also get this error afterwards:
Strict Standards: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
C:\xampp\php\pear\DB.php on line 688
I'm using a PHP class for my DB connection (kinda new to classes, so maybe
I'm not writing something out correctly):
class db{
public $server;
public $username;
private $password;
public $database;
public $connection;
public $error;
public function connect($server,$username,$password,$db){
$this->server=$server;
$this->username=$username;
$this->database=$db;
$this->connection=mysqli_connect($this->server,$this->username,$password,$this->database);
if (mysqli_connect_errno($this->connection)){
$this->error="Failed to connect to MySQL: " .
mysqli_connect_error();
return 0;
}else{
return 1;
}
}
public function query($q,$fetch=""){
$Q=mysqli_query($this->connection,$q);
if($fetch==FETCH_ASSOC){
return mysqli_fetch_assoc($Q);
}else if($fetch==FETCH_ARRAY){
return mysqli_fetch_array($Q);
}else{
return $Q;
}
}
}
I'm seeing this on an index.php file in my htdocs folder of XAMPP. Does
anybody have any idea what this means? I wasn't getting these messages a
few minutes ago.

No comments:

Post a Comment