Get value from DB |
[eluser]shahnawazahmed[/eluser]
Hello everyone , i want to fetch value from db column directly from my controller , i am stucked in this task please share me the code , How can i get value from the db column in controller . please reply soon , anyone please
[eluser]shahnawazahmed[/eluser]
its my controller <?php class site extends CI_controller { function index() { $this->load->model('getdb'); $a=$this->getdb->getall(); echo $a; } } ?> and here is the model <?php class getdb extends CI_Model{ public function getall() { echo $query= $this->db->query('SELECT user_role FROM res_user'); } } ?> i want to fetch value from the db column user_role ...
[eluser]michalsn[/eluser]
Start from here: http://ellislab.com/codeigniter/user-gui...sults.html |
Welcome Guest, Not a member yet? Register Sign In |