You are here

function ARC_api::db_connect in Taxonomy import/export via XML 6

Same name and namespace in other branches
  1. 5.2 arc/ARC_api.php \ARC_api::db_connect()
  2. 5 arc/ARC_api.php \ARC_api::db_connect()
  3. 6.2 arc/ARC_api.php \ARC_api::db_connect()
1 call to ARC_api::db_connect()
ARC_api::custom_destruct in arc/ARC_api.php

File

arc/ARC_api.php, line 117

Class

ARC_api

Code

function db_connect() {
  if (!($this->db_con = @mysql_connect($this->config["db_host"], $this->config["db_user"], $this->config["db_pwd"]))) {
    return $this
      ->error("Could not connect to database server '" . $this->config["db_host"] . "'.");
  }
  elseif (!($this->db = @mysql_select_db($this->config["db_name"], $this->db_con))) {
    return $this
      ->error("Could not select database '" . $this->config["db_name"] . "'.");
  }
  @mysql_query('SET NAMES "utf8"');
  return true;
}