Advertisement
zkyhndk

db

Jan 8th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. $DB_HOST = 'localhost';
  4. $DB_USER = 'test';
  5. $DB_PASS = "test";
  6. $DB_NAME = 'test';
  7.  
  8. try {
  9.  
  10. $DB_CON = new PDO('mysql:host='.$DB_HOST.';dbname='.$DB_NAME,$DB_USER,$DB_PASS);
  11. $DB_CON->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  12.  
  13. } catch (PDOException $ex){
  14.  
  15. echo $ex->getMessage();
  16.  
  17. }
  18.  
  19. include_once 'CRUD.php';
  20. include_once 'error.php';
  21.  
  22. $crud = new CRUD($DB_CON);
  23. $error = new ERRORS();
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement