Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "";
  5.  
  6. try {
  7. $conn = new PDO("mysql:host=$servername;dbname=flag", $username, $password);
  8. // set the PDO error mode to exception
  9. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  10. //echo "Connected successfully";
  11. $conn->query("SET NAMES 'utf8' ");
  12. }
  13. catch(PDOException $e)
  14. {
  15. echo "Connection failed: " . $e->getMessage();
  16. }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement