Файл: test.otwap.aux.su/pages/stat.php
Строк: 11
<?
@mysql_query("SET CHARACTER SET cp1251");
@mysql_query("SET NAMES cp1251");
if (isset($_GET[id])) {
$query = "SELECT * FROM `sites` WHERE `category` = '$_GET[id]'";
$set = select($query);
while ($row = mysql_fetch_array($set)) {
echo "<a href = '$row[url]' target='_blank'>$row[name]</a><br>";
}
} else {
echo "<table align=center cellspacing=5><tr>";
for ($i=0;$i<=2;$i++) {
$from = $i*18;
$query = "SELECT * FROM `category_site` LIMIT $from, 20";
$set = select($query);
echo "<td>";
while ($row = mysql_fetch_array($set)) {
$query = "SELECT COUNT(*) FROM `sites` WHERE `category` = '$row[id]'";
$coun = select($query);
$count = mysql_fetch_row($coun);
echo "<a href = '?id=$row[id]'>$row[name]</a> ($count[0])<br>";
}
echo "</td>";
}
echo "</tr></table>";
}
?>