Skip to content

Instantly share code, notes, and snippets.

@KimiyukiYamauchi
Created December 9, 2013 12:38
Show Gist options
  • Save KimiyukiYamauchi/7871663 to your computer and use it in GitHub Desktop.
Save KimiyukiYamauchi/7871663 to your computer and use it in GitHub Desktop.
<?php
function connect_mysql(){
$db = MDB2::connect('mysql://test:pass@localhost/testphp');
if (MDB2::isError($db)) { die("connection error: " . $db->getMessage()); }
return $db;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment