KotOFF
Освоившийся
Дата регистрации:
25.05.2012 10:21:29
Сообщений: 33
SELECT * FROM
(SELECT id,title,description,author,date,view FROM articles
UNION
SELECT id,title,description,author,date,view FROM news) AS t
ORDER BY t.id DESC
Только не пойму где ошибка?
Вот весь код:
<?php
$result = mysql_query ("
SELECT * FROM
(SELECT id,title,description,author,date,view FROM articles
UNION
SELECT id,title,description,author,date,view FROM news) AS t
ORDER BY t.id DESC",$db);
$myrow = mysql_fetch_array($result);
do {
printf ("<table>
<tr>
<td><p><a href='ссылка.php?id=%s'>%s</a></p></td>
</tr>
<tr>
<td><p>%s</p><p>Дата: %s Добавил(a): %s Просмотры: %s</p></td>
</tr>
</table>< br><br>",$myrow["id"],$myrow["title"],$myrow ["description"],$myrow["date"],$myrow["author"],$myrow["view"] );
}
while ($myrow = mysql_fetch_array($result));
?>