Advertisement
Guest User

Untitled

a guest
Jul 20th, 2016
91
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. $datos = array(
  3. 'USERNAME' => 'root',
  4. 'PASSWORD' => 'root'
  5. );
  6.  
  7. $dsn = "mysql:unix_socket=/Applications/MAMP/tmp/mysql/mysql.sock;dbname=destinos;user=root;password=root;charset=utf8";
  8.  
  9. try {
  10. $conexion = new PDO($dsn, $datos['USERNAME'], $datos['PASSWORD']);
  11.  
  12. } catch(PDOException $e) {
  13. echo "Error: " . $e->getMessage();
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement