• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI FULLTEXT pagination

#1
[eluser]smartweb[/eluser]
Hi,
I have a database, which has 1.5 million records. I need to constantly query the database and generates the paging record. Who can tell me how to write the T-the sql?

The table structure is as follows

CREATE TABLE IF NOT EXISTS `test` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(200) DEFAULT NULL,
`body` text,
PRIMARY KEY (`id`),
FULLTEXT KEY `title` (`title`,`body`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=86 ;

#2
[eluser]smartweb[/eluser]
My wrong class here

function getproudctsList($page,$pagesize,$class,$region)//产品列表
{
//$sql = "select * from coname_infor where match (coname) AGAINST ('".$t."*' IN BOOLEAN MODE) ";
//
$str_search=$class." ".$region."*";
$query=$this->db->where("MATCH (`title`,`body`) AGAINST ('$str_search' IN BOOLEAN MODE)")->get("test");
$this->total ==$query->num_rows();
$query=$this->db->where("MATCH (`title`,`body`) AGAINST ('$str_search' IN BOOLEAN MODE)")->get("test",$pagesize,$page)->result_array();

return $query;
}


return error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AGAINST ('all all*' IN BOOLEAN MODE)' at line 3


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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