Return to Snippet

Revision: 30515
at August 16, 2010 17:53 by kaartz


Initial Code
$hostname = 'localhost';
$username = 'username';
$password = 'password';

try {
    $dbh = new PDO("mysql:host=$hostname;dbname=mysql", $username, $password);
    }
catch(PDOException $e)
    {
    echo $e->getMessage();
    }

Initial URL

                                

Initial Description

                                

Initial Title
PDO Connect - MySQL

Initial Tags
mysql, php

Initial Language
PHP