<?php

/**
 * Description of ConDB
 *
 * @author admin@3embed
 */
class ConDB {

    //put your code here
    // private $serverName = "127.0.0.1:1091"; //serverName\instanceName
    // private $userName = "root";
    // private $pass = "3InBed";
    // private $database = "snapchat";
    //  public $host = 'http://108.166.190.172:81/snapchat/';
    private $serverName = "localhost"; //serverName\instanceName
    private $userName = "ctcwor5_dtmaster";
    private $pass = "031988";
    private $database = "ctcwor5_dtr";
    public $host = 'localhost';
    public $conn;
    public $flag_conn;

    public function __construct() {

		$this->conn = mysql_connect($this->serverName, $this->userName, $this->pass);

        if ($this->conn) {
            if (mysql_select_db($this->database, $this->conn)) {
                $this->flag_conn = 0;

			} else {
                $this->flag_conn = 1;
                die(print_r(mysql_errors(), true));
            }
        } else {
            $this->flag_conn = 1;
            die(print_r(mysql_error(), true));
        }
    }

    public function _cleanInputs($array) {



        foreach ($array as $key => $value) {
            if (is_array($value)) {
                sanitate($value);
            } else {
                $array[$key] = mysql_real_escape_string($value);
            }
        }
        return $array;
    }

    public function close($db) {
        mysql_close($this->conn);
    }

}

?>