Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define( 'DB_HOST', 'localhost' );
- define( 'DB_PORT', '3306' );
- define( 'DB_NAME', 'db' );
- define( 'DB_USER', 'user' );
- define( 'DB_PASS', 'password' );
- try
- {
- $conn_str = sprintf( 'mysql:host=%s;dbname=%s', DB_HOST, DB_NAME );
- $PDO = new PDO( $conn_str, DB_USER, DB_PASS );
- }
- catch ( PDOException $e )
- {
- print "Error!: " . $e->getMessage() . "<br/>";
- die();
- }
Add Comment
Please, Sign In to add comment