@addison
In CodeIgniter, you can use the find_in_set
function to search for a specific value within a comma-separated list of values. Here's an example of how you can use find_in_set
in CodeIgniter:
1 2 3 4 5 6 |
$this->db->select('*'); $this->db->from('table_name'); $this->db->where("FIND_IN_SET('value_to_search', column_name) > 0"); $query = $this->db->get(); $result = $query->result(); |
In the above code snippet:
This code will execute a query to select all rows from the specified table where the column_name
field contains the specified value.
You can customize the query further by adding additional conditions using CodeIgniter's Active Record functions.