Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h1>Hello Cloudreach!</h1>
- <h4>Attempting MySQL connection from php...</h4>
- <?php
- $host = 'localhost';
- $user = 'root';
- $pass = 'pw';
- $db = 'subscriber_schema';
- $charset = 'utf8_general_ci';
- $dsn = "mysql:host={$host};dbname={$db};charset={$charset}";
- // $options = [
- // PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
- // PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
- // PDO::ATTR_EMULATE_PREPARES => false,
- // ];
- try {
- $pdo = new PDO($dsn, $user, $pass, []);
- } catch (\PDOException $e) {
- throw new \PDOException($e->getMessage(), (int)$e->getCode());
- }
- ?>
Add Comment
Please, Sign In to add comment