function registerUser() { // $username=$_POST['username']; // $password=$_POST['password']; // $u=new User(); $db = DataBase::getInstance(); p($db->fetchObjects("Select * from users WHERE id=2")); //print_r($u->select('*')->where('id','=',2)->andwhere('id','=',2)->first()); }
function __construct() { $this->db = DataBase::getInstance(); if (!isset($key)) { $this->key = 'id'; } if (!isset($table)) { $cls = get_called_class(); $tmp = explode('\\', $cls); $this->table = strtolower(array_pop($tmp)) . 's'; } }
function __construct() { $this->db = DataBase::getInstance(); }