CodeIgniter 3 - Search if value exist in blob column #32
-
Im new to CodeIgniter and working on CodeIgniter 3 project. I am trying to count if a value(TrackingNo) 33333 exists in a blog column of a mysql table(ci_line_haul). 'One' blob record will have values like As you can see above, each value is seperated by a new line. (Im using blob because it preserves the new line format, when i fetch). How do i use CodeIgniter to check if a value exists in one of those lines? If found, it should count as one. Below is what i tried, but it fails. $trno = '12345'; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
First of all I don't recommend using Codeigniter's own query builder. It doesn't seem right to me. but in my case I can use RAW Query for this purpose. return $this->db->query('select count("id") from table_name where TrackingNo like "$trackingNo"')->result_array(); I haven't tested this code but if you encounter some error then you can commnet below. |
Beta Was this translation helpful? Give feedback.
First of all I don't recommend using Codeigniter's own query builder. It doesn't seem right to me. but in my case I can use RAW Query for this purpose.
I haven't tested this code but if you encounter some error then you can commnet below.