Google
Edit File: ConDB.php
<?php error_reporting(0); /** * Description of ConDB * * @author admin@optime */ // date_default_timezone_set("Asia/Calcutta"); class ConDB { //put your code here private $serverName = "localhost"; //serverName\instanceName private $userName = "pinnacle-s_db"; private $pass = "ILoveIndia@789"; private $database = "pinnacle-s_db"; /* private $serverName = "localhost"; //serverName\instanceName private $userName = "root"; private $pass = ""; private $database = "flamer_nofacebook"; */ public $conn; //public $flag_conn; public function __construct(){ $this->db = new mysqli($this->serverName, $this->userName,$this->pass,$this->database); if($this->db->connect_errno > 0){ die('Unable to connect to database [' . $this->db->connect_error . ']'); } /* if($this->conn) { if(mysqli_select_db($this->database,$this->conn)){ $this->flag_conn = 0; }else{ $this->flag_conn = 1; die( print_r( mysqli_error(), true)); } }else{ $this->flag_conn = 1; die( print_r( mysqli_error(), true)); }*/ $this->conn = mysqli_connect($this->serverName, $this->userName,$this->pass); if($this->conn) { // echo "1"; if(mysqli_select_db($this->conn,$this->database)){ $this->flag_conn = 0; }else{ $this->flag_conn = 1; die( print_r( mysqli_errors(), true)); } }else{ $this->flag_conn = 1; die( print_r( mysqli_error(), true)); } } public function close($db){ // mysql_close($db); } } ?>