Advertisement
Guest User

Untitled

a guest
Jan 27th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <?php
  2.  
  3. $hostname = 'localhost';
  4. $username = 'root';
  5. $password = '';
  6. $database = 'calendario';
  7.  
  8. try {
  9. $conexao = new PDO("mysql:host=$hostname;dbname=$database", $username, $password,
  10. array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
  11. //echo 'Conexao efetuada com sucesso!';
  12. }
  13. catch(PDOException $e)
  14. {
  15. echo $e->getMessage();
  16. }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement