DSNs in TF context
From Tangra Framework Wiki
By default Tangra Framework uses ADOdb as database abstraction layer in order to provide applications with independence from underlaying RDBMS.
DSNs provide universal mechanism to supply connection parameters for connecting to DB.
They are formed in following manner:
$driver://$username:$password@hostname/$database?options[=value]
Where:
- $driver is database drivers like "mysql" or "mysqlt". TF applications usually use transactions so "mysqlt" is the most common driver used.
- $username - username of the account
- $password - password of the account. Please note that if $password contains special symbols as /:? you have to use rawurlencode() PHP function to encode it. If you have strange "Access denied" messages when connecting to DB and you are sure that your username and passwords are correct - may be you have to rawurlencode() your password.
- $database - name of the database. Examples: tcc, my_db
- options[=value] pairs - you can pass additional parameters to your database. Pairs are separates with & (ampersand). Common option used in TF applications is "persist".
Examples:
mysqlt://tcc:tccpass@localhost/tcc_db?persist mysqlt://my_user:1234@localhost/my_db?persist&port=3307 mysqlt://ogre:das239aar2@localhost/testbase?new

