Advertisement
Pirifey

conn_db.php

Jul 26th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: Piotr
  5.  * Date: 7/26/2017
  6.  * Time: 4:17 PM
  7.  */
  8.  
  9. $db_usr      = '';
  10. $db_nm       = '';
  11. $db_usr_pass = '';
  12. $lhost       = '';
  13.  
  14. try{
  15.     $conn = new PDO("mysql:host={$lhost};dbname={$db_nm}", $db_usr, $db_usr_pass);
  16.     $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  17. }catch(PDOException $e){
  18.     echo $e->getMessage();
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement