I have a database with the first table, wherein the table comprises 3 fields like the example below, but I do not understand how to create a query by taking one of the data on the name
field that has a few words and?
Table school
id | name | class
--------------------------------------
01 | smith, john, billy | III
02 | ana, jach, georgre | IV
Controllers
//suppose I want to take the data 'smith' on the field name
$name = $this->input->post('name');
$data = $this->models->get_name($name);
$this->load->view('layout/wrapper', $data);
example Query on Models
public function get_name($name){
$sql = "SELECT * FROM school
WHERE name.name = '".$name."'";
return $this->db->query($sql)->row_array();
}