Hi, I'm going through the tutorials for doctrine and liking it so far, however I'm stuck at the point of dropping/regenerating the db schema.
This is the code I am using (pretty much straight from the tutorial)
require_once(dirname(__FILE__) . '/lib/vendor/doctrine/Doctrine.php');
spl_autoload_register(array('Doctrine', 'autoload'));
$manager = Doctrine_Manager::getInstance();
$manager->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true);
$manager->setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true);
$dsn = 'mysql:dbname=test;host=127.0.0.1';
$user = 'root';
$password = 'test';
$dbh = new PDO($dsn, $user, $password);
$conn = Doctrine_Manager::connection($dbh);
$conn->setOption('username', $user);
$conn->setOption('password', $password);
Doctrine::loadModels('models');
Fatal error: Uncaught exception 'Doctrine_Connection_Exception' with message
'You must create your Doctrine_Connection by using a valid Doctrine style dsn in order
to use the create/drop database functionality'
Can anyone tell me the correct syntax to use for the DSN, the examples given are a little confusing.
I'm running on localhost through XAMPP.
Any advice appreciated.
Thanks.