2001-02-17 08:37:32 +00:00
|
|
|
<?php
|
|
|
|
/***************************************************************************
|
2001-02-22 06:10:12 +00:00
|
|
|
* db.php
|
2001-02-17 08:37:32 +00:00
|
|
|
* -------------------
|
|
|
|
* begin : Saturday, Feb 13, 2001
|
|
|
|
* copyright : (C) 2001 The phpBB Group
|
|
|
|
* email : support@phpbb.com
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
|
2001-02-22 06:10:12 +00:00
|
|
|
switch($dbms)
|
|
|
|
{
|
2001-02-22 18:59:06 +00:00
|
|
|
case 'mysql':
|
|
|
|
include('db/mysql.'.$phpEx);
|
|
|
|
break;
|
|
|
|
case 'postgres':
|
|
|
|
include('db/postgres7.'.$phpEx);
|
|
|
|
break;
|
|
|
|
case 'mssql':
|
|
|
|
include('db/mssql.'.$phpEx);
|
|
|
|
break;
|
2001-02-25 15:11:25 +00:00
|
|
|
case 'odbc':
|
|
|
|
include('db/odbc.'.$phpEx);
|
|
|
|
break;
|
2001-02-22 18:59:06 +00:00
|
|
|
case 'oracle':
|
|
|
|
include('db/oracle.'.$phpEx);
|
|
|
|
break;
|
2001-02-22 06:10:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Make the database connection.
|
|
|
|
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
|
2001-02-22 18:59:06 +00:00
|
|
|
if(!$db)
|
2001-02-22 06:10:12 +00:00
|
|
|
{
|
2001-02-25 01:23:32 +00:00
|
|
|
$db_error = $db->sql_error();
|
2001-05-17 00:14:38 +00:00
|
|
|
error_die(SQL_CONNECT, $db_error['message']);
|
2001-02-22 06:10:12 +00:00
|
|
|
}
|
2001-02-25 15:11:25 +00:00
|
|
|
|
2001-05-17 00:14:38 +00:00
|
|
|
?>
|