The used SELECT statements have a different number of columnsSELECT * FROM ecms_blog WHERE title like '%{$keyboard}%') union all (SELECT * FROM ecms_photo WHERE title like '%{$keyboard}%') LIMIT 100这两个表的字段有一些不同,请问怎么改,谢谢
调试欢乐多
建议select时候别用*
select c1,c2,c3,c4 from table1 where 1=1 union all (select t1 as c1,t2 as c2,t3 as c3 from table2 where 2=2) limit 100
SELECT * FROM ecms_blog WHERE title like '%{$keyboard}%') union all (SELECT * FROM ecms_photo WHERE title like '%{$keyboard}%') LIMIT 100 //union前面是不多多了一个括号啊 那个括号是干嘛的吗