Guest User

Untitled

a guest
Oct 31st, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. <?php
  2. /* Create Database configuration */
  3. $server = "localhost";
  4. $username = "root";
  5. $password = "";
  6. $database = "Library";
  7.  
  8. /* Begin Connection */
  9. try{
  10. /* Setup PDO Connection */
  11. $connection = new PDO("mysql:host=$server;dbname=$database",$username,$password);
  12. echo " Connected ! ";
  13.  
  14. }catch(PDOException $e){
  15. /* Any connection Errors */
  16. echo "Error : " . $e->getMessage();
  17. }
  18.  
  19. ?>
Add Comment
Please, Sign In to add comment