$cha="php";
$re = Db::field('id name')->table('jd_article')->union("SELECT id name FROM jd_new where name like '%" . $cha . "%'")->where("name like '%" . $cha . "%'")->paginate(3);
print_r($re);而三个参数以上呢?却不行$cha="php";
$re = Db::field('id name logo')->table('jd_article')->union("SELECT id name logo FROM jd_new where name like '%" . $cha . "%'")->where("name like '%" . $cha . "%'")->paginate(3);
print_r($re);报错:[code]SQLSTATE[42000]: Syntax error or access violation: 1064 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 'logo FROM jd_new where name like '%php%'' at line 1[code]郁闷...求解! 最佳答案