Hi I want to list some users from a table in my data base.
Model:
class listPatients {
private $list_patients;
function __construct() {
$this->list_patients = array($patient);
}
//put your code here
function list_patients() {
$this->db->from('Users');
$this->db->where('patient', 1);
$this->db->select('id, username, Email');
$patient[]=$this->db->get()->result();
return $patient[];
}
`
View
<?php echo $patient[] ?>
Control:
public function list_patients() {
$data["list_patients"] = $this->listPatients->list_patients();
$this->load->view('mainview',$data);
}
I want to show a list of the patients(Users with column patient = 1) and I am getting some problems can someone help