I am developing an application using Codeigniter 2.1.0 and MySQL. In my application I have a search feature. Here is code for search.
function get_results($query, $post_per_page,$current_page) {
$offset=($current_page-1)*$post_per_page;
if($current_page==1) {
$offset = 0;
}
$sql = "SELECT * FROM data WHERE MATCH ( source ) AGAINST (?) LIMIT ?,?";
$query = $this->db->query($sql, array($query, $offset, $post_per_page));
return $query->result_array();
}
Sample paragraph is
CodeIgniter User Guide Version 2.1.0 Getting Started With CodeIgniter Any software application requires some effort to learn. We've done our best to minimize the learning curve while making the process as enjoyable as possible. The first step is to install CodeIgniter, then read all the topics in the Introduction section of the Table of Contents. Next, read each of the General Topics pages in order. Each topic builds on the previous one, and includes code examples that you are encouraged to try. Once you understand the basics you''ll be ready to explore the Class Reference and Helper Reference pages to learn to utilize the native libraries and helper files.
I perform a query "codeigniter" and "User Guide" But this function returns 0 results on both queries. However words "codeigniter" and "User Guide" are exists in the sample paragraph. Please suggest some helpful code or ideas for this problem