<?php
class Dbmysql extends Model {

public $conn = null;

	function __construct() {
		parent::Model();

		$config['hostname'] = "localhost";
		$config['username'] = "root";
		$config['password'] = "vertrigo";
		$config['database'] = "bp";
		$config['dbdriver'] = "mysql";
		$config['dbprefix'] = "";
		$config['pconnect'] = false;
		$config['db_debug'] = true;
		$config['active_r'] = true;
		
		$this->db = $this->load->database($config, true);
		$this->db->query("SET NAMES utf8");
		$this->db->query("SET CHARACTER SET utf8");
		$this->db->query("SET COLLATION_CONNECTION='utf8_czech_ci'");
	}
	
	function escape_string($str)
	{
		return mysql_real_escape_string($str, $this->db->db_connect());
	}
	
	function insert_id()
	{
		return mysql_insert_id();
	}
}
?>
