Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?php
  2. class database{
  3. function __construct()
  4. {
  5. $db_user="root";
  6. $db_pass="";
  7. try {
  8. $con = new PDO('mysql:host=localhost;dbname=hrm', $db_user, $db_pass);
  9. $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  10. }
  11. catch(PDOException $e)
  12. {
  13. echo $e->getMessage();
  14. }
  15. }
  16. }
  17.  
  18. <?php
  19.  
  20. session_start();
  21.  
  22. class user
  23. {
  24.  
  25. private $db;
  26.  
  27. function __construct(){
  28.  
  29. require_once "../dbconfig.php";
  30. $this->db= new database();
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement