• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get value from DB

#1
[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

#2
[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 ...

#3
[eluser]michalsn[/eluser]
Start from here: http://ellislab.com/codeigniter/user-gui...sults.html


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.