联系官方销售客服
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}
运行正常,能取出数据,但是页面报错,怎么解决?