Guest User

Untitled

a guest
Jan 13th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <h1>Hello Cloudreach!</h1>
  2. <h4>Attempting MySQL connection from php...</h4>
  3. <?php
  4.  
  5. $host = 'localhost';
  6. $user = 'root';
  7. $pass = 'pw';
  8. $db = 'subscriber_schema';
  9. $charset = 'utf8_general_ci';
  10.  
  11. $dsn = "mysql:host={$host};dbname={$db};charset={$charset}";
  12. // $options = [
  13. // PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
  14. // PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
  15. // PDO::ATTR_EMULATE_PREPARES => false,
  16. // ];
  17. try {
  18. $pdo = new PDO($dsn, $user, $pass, []);
  19. } catch (\PDOException $e) {
  20. throw new \PDOException($e->getMessage(), (int)$e->getCode());
  21. }
  22. ?>
Add Comment
Please, Sign In to add comment