CodeIgniter Forums
Building a Related Records Function? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Building a Related Records Function? (/showthread.php?tid=32908)



Building a Related Records Function? - El Forum - 08-09-2010

[eluser]Corey Freeman[/eluser]
I've been trying to use the $this->db->like() function, however, that seems to be returning things that only have the EXACT words, regardless of length. Is there a different function I need to use to build a kind of "related entries" function, or a parameter to set?

Please help...

Corey


Building a Related Records Function? - El Forum - 08-09-2010

[eluser]mddd[/eluser]
Why don't you check the Mysql manual for LIKE.
In short : column_name LIKE '%php%' will find any string containing 'php'.

If you want more extensive searching you should check out MATCH. And if you want real 'related items' functionality, you'll have to build something yourself, by linking keywords to your items and looking for items that have the same keywords..