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!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.