<?
$host = "site.ru";
$user = "mysql";
$pass = "mysql";
$base = "baza";
$con = mysql_connect($host, $user, $pass); mysql_select_db($base, $con);

if (!$con) { echo "Нет соединения с базой данных."; exit; }
@mysql_query("SET NAMES 'cp1251'");
?>