Is it necessary to have different DSN formats in PDO ?

php.internals

Andrey Nikolaev

20 years ago
What we have now is... "mssql:host=localhost;dbname=testdb" "sybase:host=localhost;dbname=testdb" "dblib:host=localhost;dbname=testdb" "mysql:host=localhost;dbname=testdb" "pgsql:host=localhost port=5432 dbname=testdb user=bruce password=mypass" "oci:dbname=//localhost:1521/mydb" "firebird:User=john;Password=mypass;Database=DATABASE.GDE;DataSource=localhost;Port=3050" "sqlite:/opt/databases/mydb.sq3" Maybe it's better to make it more standart ? Like: "driver:host=localhost; port=1234; user=bruce; password=mypass; dbname=testdb" "driver:file=/path/to/sql.socket; user=bruce; password=mypass; dbname=testdb" It's much easer to write, parse and generate. Only don't know what to do with ODBC: "odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\db.mdb;Uid=Admin" "odbc:DSN={IBM DB2 ODBC};HOSTNAME=localhost;PORT=50000;DBNAME=SAMPLE;PROTOCOL=TCPIP;UID=db2inst1;PWD=ibmdb2;"

Wez Furlong

20 years ago
That's one of the reasons why we don't do it. --Wez. On 11/2/05, Andrey Nikolaev <na@index20.ru> wrote:

Lukas Smith

20 years ago
Wez Furlong wrote:
> That's one of the reasons why we don't do it.
I once proposed that every driver should atleast be able to generate a DSN from an array through an optional function. However since I never implemented and nobody else stepped out it never materialized. regards, Lukas