Created
January 30, 2013 06:44
-
-
Save jayzeng/4671250 to your computer and use it in GitHub Desktop.
dbconnection
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 | |
// pdo | |
$pdo = new PDO("mysql:host=localhost;dbname=database", "username", "password"); | |
// mysqli, oo way | |
$mysqli = new mysqli('localhost', 'username', 'password', 'database'); | |
// mysqli, procedural | |
$mysqli = mysqli_connect('localhost', 'username', 'password', 'database'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment