Advertisement
noam76

config.php

May 13th, 2023
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "your_username";
  4. $password = "your_password";
  5. $dbname = "your_database";
  6.  
  7. try {
  8.     $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
  9.     $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  10. } catch(PDOException $e) {
  11.     echo "Connection failed: " . $e->getMessage();
  12. }
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement