I have the main page (index.php) and a database page (DB.php). Index.php makes a call at the DB page. The code appears to show no errors, but the results do not appear, which in this case is an echo statement.
<?php
require_once 'core/init.php';
DB::getInstance();
This is index.php
<?php
class DB{
private static $_instance = null;
private $_pdo,
$_query,
$_error = false,
$_results,
$_count= 0;
public function _construct(){
try{$this->_pdo = new PDO('mysql:host='.Config::get('mysql/host'). ';dbname='.Config::get('mysql/db'), Config::get('mysql/username'), Config::get('mysql/password'));
echo "sad";
}catch(PDOException $e){
die($e->getMessage());
}
}
public static function getInstance(){
if(!isset(self::$_instance)){
self::$_instance = new DB();
}
return self::$_instance;
}
}
This is DB.php
DB::getInstance();to a variable andvar_dump()it