Welcome Guest, Not a member yet? Register   Sign In
How to search out the exact result which in the array data field?
#1

Hello Madam, Sir,
I am really newbie  in codeigniter,  I like this frame much.
Now there is problem when I try to filter some product 
We have stored a products table has column  id,  name, category_id,   and the category_id stored the product cat id format  like ["4","25","31"],
which means the product   belongs to the sub cat ID 4,  and 25, 31.  at the same time.

when we want to search out all products belong to   cat ID 4 ,  we keep to use below code

$this->db->like('category_id', '4');    it returns result of  those products belong to  ["14","25","31"],  ["4","24","31"], ["9","22","34"] ..... 

we just need the result is    ["4","any","any"],  not  ["14","25","31"],  ["9","22","34"] .

How to solve this problem?

Best regards
Reply


Messages In This Thread
How to search out the exact result which in the array data field? - by Philco - 09-09-2021, 09:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB