Файл: selemege.tk/gifts_vip/count.php
Строк: 10
<?
//////////podarki vip
echo"<td class='p_t'>";
echo "<small><b>ViP</b> Подарки/<a href="gifts_vip.php?id=$ank[id]" title="Все">Все</a></small>n";
$k_p=mysql_result(mysql_query("SELECT COUNT(*) FROM `gifts_vip` WHERE `id_user` = $ank[id] ",$db), 0);
echo " ($k_p)<br />";
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `gifts_vip` WHERE `id_user` = '$ank[id]' LIMIT 1"), 0);
if ($k_post==0)
{
echo '<sub>У обитателя '.$ank['nick'].' нет <b>ViP</b> подарков</sub>';
}
$q = mysql_query("SELECT * FROM `gifts_vip` WHERE `id_user` = '$ank[id]' ORDER BY time DESC LIMIT 5");
while ($pod = mysql_fetch_array($q))
{
$a = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$pod[ot_id]' LIMIT 1"));
echo"<img src='/gifts_vip".$pod['link']."' width='50' height='50' alt='' class='icon'/>";
}
echo"</td><br/>";
//////////podarki vip
?>