To connect to a database through PEAR::DB, you have to create a valid DSN - data source name. This DSN consists in the following parts:
phptype: Database backend used in PHP (i.e. mysql , odbc etc.)
dbsyntax: Database used with regards to SQL syntax etc. When using ODBC as the phptype, set this to the DBMS type the ODBC driver is connecting to. Examples: access, db2, mssql, navision, solid, etc.
protocol: Communication protocol to use ( i.e. tcp, unix etc.)
hostspec: Host specification (hostname[:port])
database: Database to use on the DBMS server
username: User name for login
password: Password for login
proto_opts: Maybe used with protocol
option: Additional connection options in URI query string format. options get separated by &
The format of the supplied DSN is in its fullest form:
Please note, that some features may be not supported by all database backends. Please refer to the PEAR DB extensions status document located at: <pear base dir>/DB/STATUS to get a detailed list about what features are supported by which backend.
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?