SELECT * FROM ( SELECT `title`, ‘img‘ AS TYPE, `id`, `orderid`, `posttime`, `content`, `description`, `checkinfo`, `linkurl`, `picurl`, `classid` FROM `#@__infoimg` WHERE parentid != 2 AND title LIKE ‘%$searchKey%‘ AND (classid = $CID OR parentstr LIKE ‘%,$CID,%‘) UNION ALL SELECT `title`, ‘list‘ AS TYPE, `id`, `orderid`, `posttime`, `content`, `description`, `checkinfo`, `linkurl`, `picurl`, `classid` FROM `#@__infolist` WHERE checkinfo = TRUE AND title LIKE ‘%$searchKey%‘ AND (classid = $CID OR parentstr LIKE ‘%,$CID,%‘) ) AS tab ORDER BY tab.orderid DESC
要注意有可能在设置中
UNION 特别的方法不能使用,这些方法有肯能出现数据的泄露。所以会部分阻止使用。