php - mysql_select_db returns false -


there working website, today error:

access denied user 'username'@'' database 'databasename' 

it doesn't show hostname. why?

i sure mysql_pconnect works correctly, mysql_select_db doesnot.

function connect() {     $this->connectionid=mysql_pconnect($this->server.(!empty($this->post) ? ":".$this->post : ""), $this->username, $this->password);     if ($this->connectionid === false) {         exit("core module error: mysql error: ".mysql_error($this->connectionid));     }      if (mysql_set_charset("utf8", $this->connectionid) !== true) {         // windows bug detected: can't initaliaze charset cp1251, try force setup         $this->query("set names 'utf8'", $this->connectionid);         $this->query("set character set 'utf8'", $this->connectionid);         $this->query("set @@collation_connection = utf8_general_ci", $this->connectionid);     }      if (mysql_select_db($this->db, $this->connectionid) === false) { //error here         exit("core module error: mysql error: ".mysql_error($this->connectionid));     }      return true; } 


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -