<?php
$sw = $_GET['s'];
$sites = array(
1 => "http://vkontakte.ru",
2 => "http://mail.ru",
3 => "http://pyha.ru",
4 => "http://pyha.ru/forum/",
);
$files = array(
1 => "./count/kontakt.xml",
2 => "./count/mail.xml",
3 => "./count/pyha.xml",
4 => "./count/pforum.xml",
);
function gets($file) {
$bin = file_get_contents($file);
return $bin;
}
function puts($file, $data) {
$f = @fopen($file, 'w+');
if (!$f) {
return false;
} else {
$bytes = fwrite($f, $data);
fclose($f);
return $bytes;
}
}
function UpCounter($file) {
$cont = gets($file);
++$cont;
$size = puts($file, $cont);
return $size;
}
if($sw == "") {
$site = $sites['1'];
$file = $files['1'];
UpCounter($file);
header ('Location: '.$site);
} else {
$site = $sites[$sw];
$file = $files[$sw];
UpCounter($file);
header ('Location: '.$site);
}
?>
Нужно реализовать тоже самое тольлко на мускуле. Впринципе понимаю но вот с SELECTом разобраться никак не могу… Помогите