Zdravim,
pri pokuse o pripojenie vypise nasledovne:
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /3w/wz.cz/l/lensp/web/class/cmysql.php on line 8
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /3w/wz.cz/l/lensp/web/class/cmysql.php on line 9
Warning: mysql_query(): Access denied for user: 'nobody@81.31.7.88' (Using password: NO) in /3w/wz.cz/l/lensp/web/class/cmysql.php on line 37
Warning: mysql_query(): A link to the server could not be established in /3w/wz.cz/l/lensp/web/class/cmysql.php on line 37
A tu je moj konstruktor:
...
class cmysql {
var $host="localhost", $link, $dbs;
// konstruktor a otvorenie databazy
function cmysql($user="pristup_meno", $pass="heslo", $dbs='databaza') {
$this->link=mysql_connect($host, $user, $pass);
$this->dbs = mysql_select_db($dbs, $this->link);
if ($this->dbs) return $this->link;
else return mysql_error();
} // koniec funkcie
...
Nerozumiem najma tomu prvemu Warningu.