Home

PHP

 
class connection{
    private $host='Your Hostname';
    private $username='UserName';
    private $password='Password';
    private $db='Database Name';
    public $con;
   
    function __construct(){
        $this->connect();       
        }
    function connect(){
       
        try{
            $this->con=new PDO("mysql:host=$this->host;dbname=$this->db", $this->username, $this->password);
            }
        catch(PDOException $e){
            $e->getMessage();
            }   
        }   
    }



Open Your favorite text editor and paste this code and enjoy........

2 comments:

  1. Very nice.......
    http://www.aheadpoints.blogspot.in/2015/01/list-of-high-pr-dofollow-social.html

    ReplyDelete