´ÙÀ½ ÀÌÀü Â÷·Ê

19. ºÎ·Ï I phpDB.inc ¿¹Á¦

Á¦ÃâÀÚ : Joe Thong darkjoe@softhome.net Site URL: http://phpdb.linuxbox.com

Description: ¿©·¯°¡Áö µ¥ÀÌÅͺ£À̽º ¼­¹ö¿¡¼­ °á°ú Á¶ÀÛÀ» À§ÇÑ °­·ÂÇÑ PHP µ¥ÀÌŸº£À̽º ·¦ÆÛ. µ¥ÀÌÅͺ£À̽ºÀÇ °á°ú°¡ phpDB¿¡ ÀÇÇØ ÀÚµ¿À¸·Î ³ª¿À°Ô µÈ´Ù.

ÀÌÈ­ÀÏÀ» ¾òÀ¸·Á¸é À¥ºê¶ó¿ìÁ®¿¡¼­ '´Ù¸¥À̸§À¸·Î ÀúÀå'À» ´©¸£°í phpDB.inc ¶ó°í ÀÔ·ÂÇϽÿÀ.


<?php
/*
Name: phpDB General module
Version: 1.02bR6
Description: A PHP database wrapper for various 
        database servers.  Database results are flushed 
        automatically by phpDB.  Supported database 
        servers are MySQL, MSQL, PostgreSQL, Microsoft 
        SQL Server and Sybase. 
*/

        if (!defined("_PHPDB_GENERAL_LAYER")) {
          define("_PHPDB_GENERAL_LAYER", 1 );
        }
        else
                return;
        
        // Fill in the database server that you're
        // going to use.  Consult the phpDB Reference
        // Manual for more information
        $databaseType = '';
        // The phpDB module root path.  No trailing slash
        $phpDBRootPath = '.';   
        
        function useDB($dbType = "") 
        {
                GLOBAL $phpDBRootPath;
                switch (strtolower($dbType)) 
                {
                        case "mysql":
                        case "msql":
                        case "postgresql":
                        case "mssql":
                        case "sybase":
                        case "informix":
                                include("$phpDBRootPath". "/phpDB-" . "$dbType.lib");
                                break;
                        case "":
                                die("Please edit phpDB.inc in order to use phpDB");
                                return false;
                        default:
                                die("Invalid database selection");
                                return false;           
                }                                       
                return true;            
        }
        
        useDB($databaseType);
?>


´ÙÀ½ ÀÌÀü Â÷·Ê