<?
error_reporting(E_ALL);
$db=mysql_connect('localhost', 'root', '');
// подключение к базе
@mysql_select_db('ferma',$db);
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);
?>