Welcome Guest, Not a member yet? Register   Sign In
How to use LIKE query in CodeIgnitor when select data from database?
#1

[eluser]PEN Vannak[/eluser]
Dear CodeIgnitor Members,

I want to use the query LIKE to select the data from database:
Example:
Code:
SELECT * FROM my_table WHERE name LIKE '%hello%';

How can I use this query in CodeIgnitor?

Thanks.
#2

[eluser]Dam1an[/eluser]
I'm assuming you're refering to using ActiveRecord? You can start by reading the User Guide Tongue

Code:
$this->db->like('title', 'match');
// Produces: WHERE title LIKE '%match%'

Thats all there is to it
#3

[eluser]PEN Vannak[/eluser]
Thank you very much!




Theme © iAndrew 2016 - Forum software by © MyBB