聯(lián)系官方銷售客服
1835022288
028-61286886
PHP程序里面
Unknown column 'updatetime' in 'order clause'
SQL查詢里面報未知的列錯誤,下面是一個多表查詢的代碼
{php $query='SELECT * FROM (( SELECT id, title, author, thumb, updatetime FROM dr_1_zikao ORDER BY updatetime DESC ) UNION ALL ( SELECT id, title, author, thumb, updatetime FROM dr_1_chengkao ORDER BY updatetime DESC ) UNION ALL ( SELECT id, title, author, thumb, updatetime FROM dr_1_zsben ORDER BY updatetime DESC ) UNION ALL ( SELECT id, title, author, thumb, updatetime FROM dr_1_dianda ORDER BY updatetime DESC ) UNION ALL ( SELECT id, title, author, thumb, updatetime FROM dr_1_yuanch ORDER BY updatetime DESC )) AS info ORDER BY updatetime DESC LIMIT 2000';} {list action=sql sql='$query' page=1 pagesize=2 urlrule=index.php?s=info&c=category&id=1&page=[page]} <li> <div class="list_l_b_img fl"> <img src="{dr_thumb($t['thumb'], 135, 75)}" alt=""> </div> <div class="list_l_b_tit fl"> <h3><a target="_blank" href="{$t['url']}">{$t['title']}</a></h3> <div class="list_zbrq"> <span>責編:{$t.author}</span> <span>{dr_date($t['updatetime'], 'Y-m-d')}</span> </div> </div> </li> {/list}
運行正常,能取出數(shù)據(jù),但是頁面報錯,怎么解決?
UNION 不要用,查詢速度太慢了
表不要查詢多了,慢死的
二樓是大神,多表聯(lián)合是他幫我寫的