query mysql_query SELECT FROM news ORDER BY time DESC LIMIT start api_

1
2
3
4
5
6
7
8
9
$query = mysql_query("SELECT * FROM `news` ORDER BY time DESC LIMIT $start, $api_settings[on_page]");
while ($newsone = mysql_fetch_assoc($query)){
$koms = mysql_result(mysql_query("SELECT COUNT(*) FROM `news_comm` WHERE `id_news` = '$newsone[id]'"),0);
if ($koms==0)$koms=NULL;
else $koms = ' +'.$koms.'';
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '$newsone[id_user]' LIMIT 1"));
echo '<div class="subhead"><strong>'.apicms_smiles(apicms_bb_code(apicms_br(htmlspecialchars($newsone['name'])))).'</strong> <span style="float:right"><small>'.apicms_data($newsone['time']).'</small></span> </br> '.apicms_smiles(apicms_bb_code(apicms_br(htmlspecialchars($newsone['txt'])))).'
<hr><a href="/modules/news_comm.php?id='.$newsone['id'].'"><small>Комментарии '.$koms.'</small></a> <span style="float:right"> <small>'.htmlspecialchars($ank['login']).'</small> <img src="/design/menu/rsnews.png"/></span></div>';
}