Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function __construct($host, $login, $password, $database, $prefix, $charset)
- {
- if(!$this->db_id = @mysql_connect($host, $login, $password))
- {
- if($this->db_error)
- {
- $this->display_error(mysql_error(), mysql_errno());
- } else
- {
- return false;
- }
- }
- if(!@mysql_select_db($database, $this->db_id))
- {
- if($this->db_error)
- {
- $this->display_error(mysql_error(), mysql_errno());
- } else
- {
- return false;
- }
- }
- $this->mysql_version = mysql_get_server_info();
- if(!$charset) $charset = "cp1251";
- if(version_compare($this->mysql_version, '4.1', ">=")) mysql_query("/*!40101 SET NAMES '" . $charset . "' */");
- $this->connected = true;
- return true;
- }
Add Comment
Please, Sign In to add comment