<?php
/* CREATE CONNECTION BY CLASS*/
 class connectionCreat
 {
	 var $hostname       =        "localhost";
	 var $username       =        "rudraanshgroup_rudransh";
	 var $password       =        "India@ks";
	 var $database       =        "rudraanshgroup_rudransh";
	 var $myconn;
	 
	 //start funtction forconnect to database
	 function connectToDB()
	 {
		 $conn   =  @mysql_connect($this->hostname,$this->username,$this->password);
		 
		 if(!$conn)
		 {
			 die ("Cannot connect to the database");
		 }
		 else
		 {
			 $this->myconn = $conn;
		 }
		  return $this->myconn;
	 }
	 //End funtction for connect to database 
	 
	 //function for select database
	 function selectDB()
	 {
		 mysql_select_db($this->database);
		 
		 if(mysql_error()) 
		 {
			 
		   echo "Cannot find the database ".$this->database;
		 
		 }
		 
	 }
	 // close the connection
	 function closeConnection() 
     {
        mysql_close($this->myconn);

     }
 }

?>