PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, March 13, 2022

[FIXED] Cakephp simple search engine tutorial

 March 13, 2022     cakephp, cakephp-2.0, search     No comments   

Issue

Does anyone know good tutorial step by step how to create a simple search engine, I just need to add a search feature, which would find similar phrase to content of my database fields. And if it's possible I don't want to use any plugins.


Solution

I just need to add a search feature, which would find similar phrase to content of my database fields

If your requirement is that simple then you can just stick to Model::find() and setting conditions according to your needs, for example:

$results = $this->Article->find('all', array(
    'conditions' => array('Article.title LIKE' => "%". $text ."%")
))

If your search conditions are more complex then you would need to use a more sophisticated solution, i.e. a plugin. I am going to be a little biased here and will recommend our search plugin



Answered By - Guillermo Mansilla
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing