Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function dbConnect()
- {
- try
- {
- $username = 'root';
- $password = '';
- $conn = new pdo("mysql:host=localhost;dbname=serveris;", $username, $password);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- return $conn;
- }
- catch(PDOException $e)
- {
- echo 'ERROR', $e->getMessage();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment