<?
$sot_db_host='localhost';
$sot_db_user_name='бд_пользователь';
$sot_db_password='пароль';
$sot_db_name='база';

if(!($db=@mysql_connect($sot_db_host, $sot_db_user_name, $sot_db_password))){
echo "Временная ошибка";
exit;
}

if (!@mysql_select_db($sot_db_name,$db)){

echo "Друзья, БЕЗ паники! Мы установливаем обновления ;)";
exit;
}

mysql_query('set charset utf8',$db); 
mysql_query('SET names utf8',$db); 
mysql_query('set character_set_client="utf8"',$db); 
mysql_query('set character_set_connection="utf8"',$db); 
mysql_query('set character_set_result="utf8"',$db);

$log_sql = '11492';
$_SESSION['sql_log'] = array();

function mysql_querll($sql){
global $log_sql;
$_SESSION['sql_number']++;
$tim = microtime(true);
$rez = mysql_query($sql);
$time_sql = microtime(true) - $tim;
$_SESSION['sql_time'] += $time_sql;
if($_SESSION['id_user'] == $log_sql){array_push($_SESSION['sql_log'],((round($time_sql, 3)*1000).' ms - '.$sql));}
return $rez;
}

$system_data = mysql_fetch_assoc(mysql_querll('SELECT * FROM `kolhoz_system` WHERE `id`="1"'));
$ku = mysql_fetch_assoc(mysql_querll('SELECT * FROM `kolhoz_user` WHERE `id`="'.$_SESSION['id_user'].'"'));
if($ku['id']==''){$ku = null;}

$set['p_str']=10;
?>