This error occurs when inheriting the abstract class aDB. If you do not inherit, no error will be reported.
L
L 2019-05-26 01:11:48
0
1
1160

<?php


abstract class aDB{


/*

* Connect to the database and read configuration information from the configuration file

*/

abstract public function conn();


abstract public function query ();


// abstract public function getAll();




##}



##class Mysql extends aDB{



public $link;


/*

*Connect to the database and read from the configuration file Configuration information

*/

public function conn(){

include 'config.php';

$this->link = new mysqli ($cfg['host'], $cfg['user'], $cfg['pwd'], $cfg['db']);

var_dump($this->link);

}


public function query($sql){

return $this->link- >query($sql);

}

## // public function getAll($sql){

// $res = $this->query($sql);

// var_dump($res);

// }


}

$mysql = new Mysql();

$mysql->conn();

?>

L
L

reply all(1)
L

Solved, solved, the abstract method does not give parameters, it is too careless

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template