I'm trying to get result from database using PHP OOP so I coded this example:
<?php
class Get{
private $db;
public $useame;
public function __construct(){
$this->db = new Coection();
$this->db = $this->db->dbCoect();
$inf = $this->db->prepare("select * from admins where useame = ".$_SESSION['admin_useame']."");
$inf->execute();
$inf->fetch();
}
public function get_name() {
retu $this->useame;
}
}
?>
Then I wrote at the top of my page this:
<?php
require_once 'php/functions/sanitize.php';
$adm = new Admin();
echo $adm->get_name();
?>
But the problem is it does not show anything ,I mean no error appears and no results at all! So what's going wrong with this code ?
