Skip to content

Instantly share code, notes, and snippets.

@viccherubini
Created December 14, 2009 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viccherubini/256017 to your computer and use it in GitHub Desktop.
Save viccherubini/256017 to your computer and use it in GitHub Desktop.
<?php
require_once 'Artisan/Db.php';
require_once 'Artisan/Exception.php';
$db_config = array(
'server' => 'localhost',
'username' => 'username',
'password' => 'password',
'database' => 'dbname'
);
$db = new Artisan_Db($db_config);
try {
$db->connect();
// Do some SQL
$db->disconnect();
} catch ( Artisan_Exception $e ) {
exit('An error occurred: ' . $e->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment