PDA

View Full Version : In dire need of help, please check [PHP error]


E
04-29-2003, 06:51 PM
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/fiendwor/public_html/forum/admin/db_mysql.php on line 40

I havent touched this file at all, & I have no clue why it has an error in it.

I went into the file & found line 40 [using EditPlus]

This is line 40

$this->link_id=mysql_connect($this->server,$this->user,$this->password);


& here are the codes surrounding it -

function connect() {
global $usepconnect;
// connect to db server

if ( 0 == $this->link_id ) {
if ($this->password=="") {
if ($usepconnect==1) {
$this->link_id=mysql_pconnect($this->server,$this->user);
} else {
$this->link_id=mysql_connect($this->server,$this->user);
}
} else {
if ($usepconnect==1) {
$this->link_id=mysql_pconnect($this->server,$this->user,$this->password);
} else {
$this->link_id=mysql_connect($this->server,$this->user,$this->password);
}
}
if (!$this->link_id) {
$this->halt("Link-ID == false, connect failed");
}
if ($this->database!="") {
if(!mysql_select_db($this->database, $this->link_id)) {
$this->halt("cannot use database ".$this->database);
}
}
}
}


^ That is from line 25 down to 53.
line 53 is just a space :-\

I'm not too familiar w/ PHP,
please help if you can,
I cant stand members messaging me asking "is the site down??"
lol, Thanks in advance - peace.

grog6
04-29-2003, 06:59 PM
Isn't it a server problem ?!

E
04-29-2003, 07:05 PM
It probably was,
I decided to refresh to see if it was still working & boom..
It worked.
I was like..... how the????
lol, Thanks for the help though,
the sites up & running now
peace.