[pmwiki-users] most user-friendly method of database configuration

Ben Stallings Ben at InterdependentWeb.com
Mon Oct 16 10:18:30 CDT 2006


At risk of belaboring this thread... although we seem to have agreed on 
a $Databases global variable for ADODB configuration, we have yet to 
agree on the parameters, i.e. the keys of the subarray.

I had been using 'type','server','name','user', and 'pass', but 
referring to the ADODB documentation I see

  The dsn format is:
  $driver://$username:$password@hostname/$database?options[=value]

So now, for consistency with the documentation, I'm inclined to use

$Databases['connection_name'] = array(
  'driver' => 'mysql',
  'hostname' => 'db.example.net',
  'database' => 'database_name',
  'username' => 'user_name',
  'password' => 'example_password');

But this is complicated by the Microsoft databases, which require both a 
database type and a driver to be specified!

Marc, you said you've used ADODB in recipes before... do you have a good 
generalized connection routine that the rest of us could copy 
shamelessly?  --Ben S.




More information about the pmwiki-users mailing list