php - fetching products of current user_id -


i have function fetch products ci_products table code follows

function get_product_selections($product_ids = array()) {     $this->db->select('*');     $this->db->from('ci_products');     $this->db->where_in('product_id', $product_ids);      $products = $this->db->get();     return $products; } 

now want fetch user_id current user_id have tried few things not working have tried`

function get_product_selections($product_ids = array()) {     $this->db->select('*');     $this->db->from('ci_products');     $this->db->where_in('product_id', $product_ids);       $this->db->where('user_id',$this->session->userdata('user_id'));     $products = $this->db->get();     return $products; } 

$data = $this->db->get_where('product_ids',$product_ids); $this->db->where_in('product_ids',$data); $this->db->where('user_id',$this->session->userdata('user_id')); $query =  $this->db->get(); return $query->result_array(); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -