View Single Post
Old 11-08-2007, 07:37 PM   #14 (permalink)
sketchMedia
The Gregarious
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 718
Thanks: 29
sketchMedia is on a distinguished road
Default

Sorry my brain cant compute (out of coffee here atm :( )

what it looks like to me is that u want to know how you would extend the script to include, for example, oracle?

like this:
PHP Code:
switch($type
{

    case 
'mysql':
        include_once(
'DBmysql.php');
        
self::$DB = new DBmysql();
        break;

    case 
'mssql':
        include_once(
'DBmssql.php');
        
self::$DB = new DBmssql();
        break;
        
    case 
'oracle':
        include_once(
'DBoracle.php');
        
self::$DB = new DBoracle();
        break;

    default:
        include_once(
'DBmysql.php');
        
self::$DB = new DBmysql();
        break;


btw i removed the
PHP Code:
'DB'.$type.'.php' 
in the includes because
lets say, $type = 'oracle' u dont really need concat the value of type into the include as its a switch so type will always be equal to 'oracle' otherwise it wouldnt have fired that line if you get my drift.

If this doesnt answer your question, i must be having one of my 'dense' days again and i shall go and beat myself with a fish until my brain gets running again.
__________________
sudo chown -R us ./allyourbase
sketchMedia is offline  
Reply With Quote