Location: PHPKode > projects > FiForms Framework > FiForms/FiForms-includes/FiConnect_DB.inc.php
<?php
/*
*******************************************************************************

    FiConnect -- A database abstraction layer to facilitate querying a 
    database in PHP

    Copyright (C) 2004-2008  Daniel McFeeters

    This library 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.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.

    You should have received a copy of the GNU General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


    The original author of this library can be contacted at the following
    address:

    Daniel McFeeters
    182 Baker Rd.
    Faubush, KY 42544-6526
    email: databases [at] fiforms [dot] org
    http://www.fiforms.org/

*******************************************************************************
FiConnect_DB.inc.php

FiConnect_DB Abstract Database Connection Class Library

*******************************************************************************
*/
    
    if(!isset($FIFORMS_CONFIG))
    {
        die('No Configuration found. Did you perhaps call an include file' .
                        ' directly instead of calling it as part of the FiForms' .
                        ' application?'); 
    }
    
    require_once("FiForms_fillVars.inc.php");
    require_once($FIFORMS_CONFIG['AUTH_MODULE']);

    class FiConnect_DB
    {
        var $server;
        var $default_db;
        var $auth;
        var $connected; // true if connected

        function FiConnect_DB()
        {
            $this->server = $GLOBALS['FIFORMS_CONFIG']['DEFAULT_SERVER'];
            $this->default_db = $GLOBALS['FIFORMS_CONFIG']['DEFAULT_DATABASE'];
            $this->auth = new FiFormsAuth();
            $this->connected = FALSE;
        } // function FiConnect_DB

        function throwError($msg)
        {
            echo $msg;
        }
        
        function connect()
        {
        } // function connect
        
        function query($sql)
        {
            if(!$this->connected)
            {
                $this->connect();
            }
        } // function query

        
    } // class FiConnect_DB
?>
Return current item: FiForms Framework