hello I have a pdo warning, with expected to be string, array given... here is my code. am using sublime text 3 and php 7.0 and OOP approach of coding
this is db.php
<?php
class Database{
private static $_instance = null;
private $_pdo,
$_query,
$_error = false,
$_results,
$_count = 0;
private 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'));
} catch (PDOException $e) {
die($e->getMessage());
}
}
public static function getInstance() {
if(!isset(self::$_instance)) {
self::$_instance = new Database();
}
return self::$_instance;
}
}
?>
Comments
Post a Comment