Advertisement
Guest User

Untitled

a guest
May 8th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. <?php
  2.  
  3. $host = "localhost";
  4. $database = "mydb";
  5. $username = "root";
  6. $password = "";
  7.  
  8. try {
  9. $connection = new PDO("mysql:host=$host;dbname=$database;charset=utf8", $username, $password);
  10. } catch(PDOException $e) {
  11. echo $e->getMessage(); // message sang error if indi mag connect
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement