There are no problems with the encapsulated tests. When called on other pages, an error message always appears. Function conts() is redefined.
Fatal error: Cannot redeclare conts() (previously declared in Where did it come from Is there a problem? Does anyone know?
function MySQLModel(){ $link = null; function conts(){ // include 'conn.php'; // $link = mysqli_connect (HOST,USER,PASS,DBNAME) or die('Prompt: Database connection failed!'); define("HOST","localhost"); //Host name define("USER","root"); // Account define("PASS","root"); //Password define("DBNAME","datas"); //Database name $link = mysqli_connect(HOST,USER,PASS,DBNAME) or die('Prompt: Database Connection failed!'); return $link; } $link = conts();