Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Connects to the data base
- // To test if the connection works open the file location in your browser
- // The url looks something like localhost/experiments/emp/connect.php or www.yourhomepageurl/yourfoldername/connect.php
- $servername = "db666156632.db.1and1.com"; //http://db666156632.db.1and1.com"; //"localhost";
- $dbname = "db666156632"; //"emp";
- $username = "dbo666156632"; //"root";
- $password = "empPM395!!"; //"";
- try {
- //$sqlConnection = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
- $sqlConnection = new PDO('sqlite:$dbname.sqlite');
- // set the PDO error mode to exception
- $sqlConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- //echo "Connected successfully. ";
- }
- catch(PDOException $e)
- {
- echo "Connection to data base failed, error: " . $e->getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement