Warning: mysql_connect(): Can't connect to local MySQL server through socket ...

Cez webove rozhranie https://mysql.webzdarma.cz/ sa k databaze pripojim, ale zo skriptu nie. Dostanem toto varovanie:

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /3w/wz.cz/p/place2b/db.php on line 10

Neviete, v com je chyba?

Skript *je* na serveri webzdarma.
Odpovedajuci kod je:

$server = "mysql.webzdarma.cz";
$user = "place2b";
$password = "*";
$dbname = "place2b";

function db_connect(){
if(!mysql_connect($server, $user, $password))
return FALSE;
return mysql_select_db($dbname);
}


Vopred dakujem za pomoc.
no tak zaprve kod

function db_connect(){
if(!mysql_connect($server, $user, $password))
return FALSE;
return mysql_select_db($dbname);
}

je uplne zbytecny, uplne naprosto to same dela obycejne

mysql_connect($server,$user,$password);

Pokud bys to chtel mit v te funkci, musel bys v ramci te fce definovat ty tri promenne jako globalni, jinak se jedna o privatni promenne te funkce, ktere s temi "venku" nemaji nic spolecneho. Tedy spravne by bylo:

function db_connect(){
global $server, $user, $password;
if(!mysql_connect($server, $user, $password))
return FALSE;
return mysql_select_db($dbname);
}

Ale jak rikam, ta funkce je fakt uplne zbytecna.