Advertisement
Guest User

Untitled

a guest
Jan 31st, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1.  
  2. /*** mysql hostname ***/
  3. $hostname = 'localhost';
  4. /*** mysql username ***/
  5. $username = 'root';
  6. /*** mysql password ***/
  7. $password = '';
  8.  
  9. try {
  10. $db = new PDO("mysql:host=$hostname;dbname=test", $username, $password);
  11. /*** echo a message saying we have connected ***/
  12. }
  13. catch(PDOException $e)
  14. {
  15. echo $e->getMessage();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement