How to use LIKE query in CodeIgnitor when select data from database?

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

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

How can I use this query in CodeIgnitor?


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

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

Thats all there is to it

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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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