Search results - good query and URI - 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: Search results - good query and URI (/showthread.php?tid=51429) |
Search results - good query and URI - El Forum - 05-03-2012 [eluser]someone [/eluser] Hello, I'm working on some script and I would like to create search. My project is based on CodeIgniter and my desire is to have all code content compatibile with it. So, I have already working on the query for searching but it's not good because it doesn't support more words than one. So if I enter word "test" in my search form (assume that the test word is in database in one of fields) there will be few results, but if I enter words "test test test" (again assume that the test words are in database in one of fields) there will be no any result. My previous query: Code: $this->db->select('title, content, date, hyperlink')->or_like(array('title' => $query, 'content' => $query))->order_by('id_article', 'desc')->get('news'); And after some tweaks: Code: $this->db->select('title, content, date, hyperlink'); The next problem is with URI because if I search for "some article, today is sunny" there is problem with comma and in other cases probably with other disallowed characters too. I have read few other question there, but all that I found is Code: $this->uri->uri_to_assoc() What's the best solution for these two problems? Thanks a lot! :-) Search results - good query and URI - El Forum - 05-04-2012 [eluser]someone [/eluser] Anyone? Thanks! :-) |