Last active
September 3, 2015 16:07
-
-
Save adanzilla/3c45541ae195c4e5998a to your computer and use it in GitHub Desktop.
PHP - PDO - MySQL Connect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dsn = 'mysql:host=XXXX.XXXX.XXXX.XXXX;dbname=DBNAME'; | |
$nombre_usuario = 'dbuser'; | |
$password = 'dbpass'; | |
$opciones = array( | |
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', | |
); | |
$pdo = new PDO($dsn, $nombre_usuario, $password, $opciones); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment