How to fetch rows with a whole nominated number in a column of comma-separated values with CodeIgniter's query builder [duplicate]
I have the followings examples in be_user_profiles.subject. These are subject ids which each teacher teaches. 1// English 1,2 // English and Math etc 1,2,14 2,4,114 12,24,34 15, 23 I want to select where be_user_profiles.subject has 1. When I use the following, it outputs all which has 1 in it. So it will outputs all. I tried HAVING but it picks up only exact matches. So it shows only the first one. How can I pick up data which has the be_user_profiles.subject? $this->db->select('*'); $this->db->from('be_user_profiles'); $this->db->join('be_users', 'be_users.id = be_user_profiles.user_id'); $t
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.