Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- // ----------------------------------------------------------------------------------------------------
- // Connecting to database
- // ----------------------------------------------------------------------------------------------------
- // Database variables
- $username = "";
- $password = "";
- $hostname = "";
- $database = "";
- // Try to connect to database and set charset to UTF8
- try {
- $dbConnect = new PDO("mysql:host=$hostname;dbname=$database;charset=utf8", $username, $password);
- $dbConnect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- } catch(PDOException $e) {
- echo 'ERROR: ' . $e->getMessage();
- }
- // ----------------------------------------------------------------------------------------------------
- // / Connecting to database
- // ----------------------------------------------------------------------------------------------------
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement