Created
January 26, 2016 03:11
-
-
Save yowcow/d508126621e1b16642a2 to your computer and use it in GitHub Desktop.
Connect to MySQL with PDO in PHP
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 | |
# Specify `charset=utf8` or you get multi-byte chars as "?" | |
$dbh = new PDO('mysql:host=some-host-name;dbname=databse-name;charset=utf8', 'user', 'password'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment