Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1.  
  2. <?php
  3. function dbConnect(){
  4. try{
  5. // DB Config (Localhost)
  6. /*$username = 'root';
  7. $password = '';
  8. $conn = new pdo("mysql:host=localhost;dbname=accountsdb;", $username, $password);*/
  9.  
  10.  
  11. $username = 'root';
  12. $password = '';
  13. $conn = new pdo("mysql:host=localhost;dbname=accountsdb;", $username, $password);
  14. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  15. return $conn;
  16.  
  17. } catch(PDOException $e){
  18. echo 'ERROR', $e->getMessage();
  19. }
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement