Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *@filename DBConnection.php
- *@desc Creates a connection with the mysql DB
- */
- $dbName = "com2701"; // name of the db you want to use
- $dbHost = "mysql:host=localhost;dbname=". $dbName;
- $dbUser = "root";
- $dbPassword = "";
- $conn = null;
- try {
- $conn = new PDO($dbHost , $dbUser, $dbPassword);
- print("Connection Established!");
- }catch(PDOException $e){
- print("Not Connected". $e->getMessage());
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement