Current location: Hot Scripts Forums » Programming Languages » PHP » MySQL Error


MySQL Error

Reply
  #1 (permalink)  
Old 10-18-07, 02:57 AM
umarrana umarrana is offline
Newbie Coder
 
Join Date: Dec 2006
Location: Pakistan
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL Error

hello dear i am working on a datbase search engin but when i uplode the files on my server he gives me the error

i see this error first time


Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/.warfield/zabga/zabga.org.pk/search/db_mysql.php on line 99
Database error: cannot connect to Database Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
MySQL Error
Session halted.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-19-07, 07:35 AM
umarrana umarrana is offline
Newbie Coder
 
Join Date: Dec 2006
Location: Pakistan
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
helo

here is he code

my website url is http://www.zabga.org.pk

PHP Code:

 /* establish connection, select database */

    
if (!$this->Connected) {
      
$this->Query_ID  0;    
      if(
$this->Persistent)
        
$this->Link_ID=mysql_pconnect($DBHost$DBUser$DBPassword);
      else
        
$this->Link_ID=mysql_connect($DBHost$DBUser$DBPassword);   (Line no 99)

      if (!
$this->Link_ID) {
        
$this->halt("cannot connect to Database " mysql_error());
        return 
0;
      }

      if (!@
mysql_select_db($DBDatabase,$this->Link_ID)) {
        
$this->halt("cannot use database " mysql_error());
        return 
0;
      }
      
$server_info = @mysql_get_server_info($this->Link_ID);
      
preg_match("/\d+\.\d+(\.\d+)?/"$server_info$matches);
      
$version_str $matches[0];
      
$version explode("."$version_str);
      if (
$version[0] >= 4) {
        if (
$version[1] >= && is_array($this->Encoding) && $this->Encoding[1])
          @
mysql_query("set character set '" $this->Encoding[1] . "'"$this->Link_ID);
        elseif (
is_array($this->Encoding) && $this->Encoding[0])
          @
mysql_query("set character set '" $this->Encoding[0] . "'"$this->Link_ID);
      }
      
$this->Connected true;
    }
    
    return 
$this->Link_ID;
  } 
please if any body now about this tell me

Last edited by mab; 10-19-07 at 08:03 AM. Reason: Code tags when posting code please.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL failed to open file error.... Clark_Kent Database 1 06-10-07 07:32 AM
MySQL Syntax error gigafare PHP 4 04-19-06 03:03 AM
mysql fetch array error - what could be wrong? fatphil PHP 2 02-25-06 01:22 PM
MySQL Syntax error when using a variable for table name lppa2004 PHP 4 08-04-05 01:24 AM
wanting advice / custom mysql error page tylerc PHP 2 05-07-04 01:41 PM


All times are GMT -5. The time now is 04:24 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.