我从未尝试过,但想从几个不同的表中回显数据并按时间戳对它们进行排序。我提出的代码带有一个布尔值,我不知道为什么。
<?php
$result = mysql_query("SELECT * FROM artists ORDER BY timestamp DESC
UNION
SELECT * FROM news ORDER BY timestamp DESC
UNION
SELECT * FROM tracks ORDER BY timestamp DESC
UNION
SELECT * FROM gigs ORDER BY timestamp DESC
UNION
SELECT * FROM feature ORDER BY timestamp DESC");
while($row = mysql_fetch_array($result)){echo'News: <a href="index.html">'.$row['name'].$row['title'].$row['trackname'].$row['gigname'].'</a><br>' ;}
?>