DataModel.php/MODEL
===================
class DataModel extends Roll_Model
{
public function Data_list()
{
$this->db->cache_on();
$query = $this->db->query("SELECT * FROM user_reg");
//$query=$this->db->get('user_reg');
return $query->result();
}
}
View_all.php/VIEW
=================
table, td, th
{
border:1px solid green;
}
th
{
background-color:green;
color:white;
}
#infoMessage p{
padding: .8em;
margin-bottom: 1em;
border: 2px solid #ddd;
background: #FFF6BF;
color: #817134;
border-color: #FFD324;
text-align: center;
}
All Data (View All Data) |
| Users ID | Name | Subject | Address | Contact | Password | Action | |
|---|---|---|---|---|---|---|---|
| U_id; ?> | Uname; ?> | subject; ?> | address; ?> | Contact; ?> | email; ?> | pass; ?> |
Admin.php/CONTROLLER
====================
class Admin extends All_Users
{
public function dashboard()
{
$this->load->model('DataModel');
$fetch["pk"] = $this->DataModel->Data_list();
$this->load->view('public/View_all', $fetch);
}
}
Replies
Know the answer? Post it — somebody with the same question will find it here.