Welcome Guest, Not a member yet? Register   Sign In
Select All from datebase
#1

[eluser]Gabi3xz[/eluser]
Datebasee access
Code:
public function select_article($id) {
  
   $q = $this
            ->db
            ->select('article_title', 'article_description', 'article_keywords', 'article_content')
            ->where('id', $id)
            ->limit(1)
            ->get('article');

      if ( $q->num_rows > 0 ) {
         // person has account with us
         return $row = $q->row();
      }
      return false;
        
}

and call function
Code:
$this->load->model('call_db');
$result = $this->call_db->select_article($id);  
    
print_r($result);
I ensue a single value "Class Object ( [article_title] => title )"
Why?
I have four values in datebase.

My table from datebase http://img822.imageshack.us/img822/1391/asssiu.jpg.


Messages In This Thread
Select All from datebase - by El Forum - 06-02-2012, 03:47 AM
Select All from datebase - by El Forum - 06-02-2012, 06:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB