Guest User

Untitled

a guest
Apr 12th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <?php
  2. require_once '../connection.php';
  3.  
  4. try
  5. {
  6. $db = new PDO("mysql:host=$host;dbname=$database;charset=utf8", $user, $password);
  7. }catch(PDOException $e)
  8. {
  9. $e->getMessage();
  10. }
  11. $db = null;
  12.  
  13. <?php
  14. $host = 'localhost'; // адрес сервера
  15. $database = 'dbname'; // имя базы данных
  16. $user = 'user'; // имя пользователя
  17. $password = 'mysuperpassword'; // пароль
Add Comment
Please, Sign In to add comment