Revert "Fix encoding"
[infodrom/hallinta] / lib / dbase.php
1 <?php
2
3 require_once('dbClass.php');
4
5 function CreateDbClass() {
6   global $oDB;
7   $oDB = new dbClass();  // from dbClass2
8
9   // What dialect of SQL will we be speaking?
10
11   //$oDB->Dialect="MySQL"  // this is the default, so you can leave it commented
12   //$oDB->Dialect="Oracle";
13   //$oDB->Dialect="TSQL";
14   //$oDB->Dialect="Access";
15   //$oDB->Dialect="PostgreSQL";
16   }
17
18 function OpenDB() {
19   global $oDB;
20   CreateDbClass();
21
22   // This is where the database connection is made
23   // Uncomment the appropriate line for your database
24
25   // Using MySQL
26   // $oDB->Provider="MySQLremoveserver"  // required if MySQL is remote
27
28   if (DBDRIVER == 'pgsql')
29     return $oDB->PostgreSqlLogon(DBNAME, DBUSER, DBPASS);
30   elseif (DBDRIVER == 'mysql')
31     return $oDB->MySqlLogon(DBNAME, DBUSER, DBPASS);
32   else
33     die("Unsupported database driver");
34
35
36   // Connect via ODBC to a DSN
37   //return $oDB->OdbcLogon("northwindDSN","Northwind","userid","password");
38
39   // Connect to Oracle XE
40   // Make sure the Oracle database is loaded with the sample database
41   // $oDB->Provider="MySQLremoveserver"  // required if Oracle is remote
42   //return $oDB->OracleLogon("XE","northwind","password");
43 }
44
45 ?>