Размер файла: 2.38Kb
<?
include ("modules/info.php");
include ("modules/header_nocache.php");
//получаем данные для статистики
mysql_connect($host,$user,$parol);
mysql_select_db($database);
$query="SELECT `id` FROM `pet_tamagochi`";
$sql=mysql_query($query);
$num_all=mysql_num_rows($sql); //количество тамагочей
$query="SELECT `kind` FROM `pet_tamagochi` WHERE `kind`='dog'";
$sql=mysql_query($query);
$num_dogs=mysql_num_rows($sql); //количество щенков
$query="SELECT `kind` FROM `pet_tamagochi` WHERE `kind`='cat'";
$sql=mysql_query($query);
$num_cats=mysql_num_rows($sql); //количество котят
$query="SELECT `kind` FROM `pet_tamagochi` WHERE `kind`='parrot'";
$sql=mysql_query($query);
$num_parrots=mysql_num_rows($sql); //количество попугаев
$query="SELECT `kind` FROM `pet_tamagochi` WHERE `kind`='hamster'";
$sql=mysql_query($query);
$num_hamsters=mysql_num_rows($sql); //колчество хомяков
$query="SELECT `temper` FROM `pet_tamagochi` WHERE `temper`='good'";
$sql=mysql_query($query);
$num_good=mysql_num_rows($sql); //количество добрых
$query="SELECT `temper` FROM `pet_tamagochi` WHERE `temper`='bad'";
$sql=mysql_query($query);
$num_bad=mysql_num_rows($sql); //количество плохих
$query="SELECT `temper` FROM `pet_tamagochi` WHERE `temper`='happy'";
$sql=mysql_query($query);
$num_happy=mysql_num_rows($sql); //количество веселых
echo "<u>О питомцах:</u><br/>";
echo "Всего - $num_all<br/>";
echo "Из них(по виду):<br/>";
echo "Щенков - $num_dogs<br/>";
echo "Котят - $num_cats<br/>";
echo "Попугаев - $num_parrots<br/>";
echo "Хомяков - $num_hamsters<br/>";
echo "Из них(по характеру):<br/>";
echo "Добрых - $num_good<br/>";
echo "Злых - $num_bad<br/>";
echo "Веселых - $num_happy<br/>";
echo "<a href=\"index.php\">Назад</a>";
include ("modules/wup_link.php");
include ("modules/footer.php");
?>