Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
分页Laravel搜索:SQLSTATE[42000]_Laravel_Laravel Pagination_Laravel Scout - Fatal编程技术网

分页Laravel搜索:SQLSTATE[42000]

分页Laravel搜索:SQLSTATE[42000],laravel,laravel-pagination,laravel-scout,Laravel,Laravel Pagination,Laravel Scout,你好,谢谢你的回复。 我使用:索引和搜索mysql数据库。根据设置:'strict'=>false代码: public function searchpages(Request $request){ $query= $request->get('query'); $adpgs=[]; $pages= \App\Page::search("*".$query."*")->paginate(1); return view('content.page

你好,谢谢你的回复。 我使用:索引和搜索mysql数据库。根据设置:
'strict'=>false
代码:

   public function searchpages(Request $request){

    $query= $request->get('query');
    $adpgs=[];
    $pages= \App\Page::search("*".$query."*")->paginate(1);
    return view('content.pages_show')->with(['pages'=>$pages,'adpgs'=>$adpgs]);


}
正确提供分页链接,但单击链接时,会出现以下错误:

SQLSTATE[42000]: Syntax error or access violation: 1064 syntax error, unexpected $end, expecting FTS_TERM or FTS_NUMB or '*' (SQL: select count(*) as aggregate from `pages` where MATCH(en_id,fa_id,title,subtitle,address,phones,mobiles,brf_work_hours,moreinfo) AGAINST(**qqq** IN BOOLEAN MODE))

如图所示。为什么以及我最喜欢做什么?

试试这个
$pages=\App\Page::search(“%”.$query.“%”)->paginate(1)非常感谢;它起作用了!但是为什么呢?请回答接受