This semi-goes here, so I'm going to post it here.

Some of you may remember me. I'm Daniel, I usually go by the alias enmand now, but AntiOnline doesn't allow you to change your nickname (if a mod could do that for me, it would be great ;-))

Anyhow, before I digress to much, let me get on topic. As some of you may, or may not know, some people and I are developing a new website system, (I don't really like CMS, because it's not just a CMS, really, we're planning on a lot of cool features). Before we can do that however, we need volunteers to help us develop.

The system will be coded in object oriented PHP, so PHP knowledge is required. As well, we will support multiple databases (including mySQL, pgSQL and MSSQL), but I will get to that part later on. So knowledge in any SQL language is required.

At the moment, we're also looking for people to help use create the database classes themselves.

I've coded a mySQL class, and it looks like this:

PHP Code:
class mysqldb extends config {
    var 
$link;
    var 
$_query;
    function 
getSettings() {
    
// Gets the settings from the conf.php page, we could probably just put this in each function we needed as $settings = config::getSettings();
    // but what fun is that?
        
$settings config::getSettings();
        return 
$settings;
    }
    
    function 
dbconnect() {
    
// Actually connect to the mySQL database using the universial $dblink->dbconnect(); function, but first check and see which way to connect.
    // either UNIX sockets, or directly to the host using PHP's mySQL client. You can set this in the conf.php.
        
$settings $this->getSettings(); // Calls our settings from the getSetting() command... see, it wasn't TOTALLY useless...
        
        // Do the checks we need, just to be sure we get the right connection method. 
        
if(!$settings['dbhostc']  && !$settings['dbsockc']){
            die(
"You must choose atleast one connection method.");
        }elseif(
$settings['dbhostc'] && $settings['dbsockc']){
            die(
"Please only choose one connection method.");
            
        }elseif(
$settings['dbhostc']){ // Now get to working on the connection. SQL is fun.
            
$dbname $settings['dbname'];
            
$host $settings['dbhost']; // Set the host, to a more usable variable.
            
if($settings['dbport'] == '' || $settings['dbport'] == NULL){
                
$port '3306';
            }else{
                
$port $settings['dbport'];
            }
            
            
// Do some security checks on the mySQL username and password... if someone isn't going to tell them, I should.
            
if($settings['dbuser'] == 'root' && $settings['allowroot'] == 0){
                die(
"You are trying to establish a connection as the root mySQL user. This is very insecure. If you wish to establish a connection as root still, please set \$config->settings['allowroot'] to '1'.");
            }else{
                
$user $settings['dbuser']; // Assign usernamne to a more usable variable.
            
}
            if(
$settings['dbpass'] == '' && $settings['allownopass'] == 0){
                die(
"You are trying to establish a connection with a user with no password. This is very insecure. If you wish to establish a connection with a passwordless user still, please set \$config->settings['allownopass'] to '1'.");
            }else{
                
$pass $settings['dbpass']; // Assign password to a more usable variable.
            
}
            
$this->link mysql_connect("$host:$port","$user","$pass") or die("Cannot connect");
            
mysql_select_db($dbname) or die("Cannot select your database");
            
        }elseif(
$settings['dbsockc']){
            
$dbname $settings['dbname'];
            
// Do some security checks on the mySQL username and password... if someone isn't going to tell them, I should.
            
if($settings['dbuser'] == 'root' && $settings['allowroot'] == 0){
                die(
"You are trying to establish a connection as the root mySQL user. This is very insecure. If you wish to establish a connection as root still, please set \$config->settings['allowroot'] to '1'.");
            }else{
                
$user $settings['dbuser']; // Assign usernamne to a more usable variable.
            
}
            if(
$settings['dbpass'] == '' && $settings['allownopass'] == 0){
                die(
"You are trying to establish a connection with a user with no password. This is very insecure. If you wish to establish a connection with a passwordless user still, please set \$config->settings['allownopass'] to '1'.");
            }else{
                
$pass $settings['dbpass']; // Assign password to a more usable variable.
            
}
            
$socket $settings['dbspath']; // Set the socket to a more useable variable.
            
$this->link mysql_connect(":$socket""$user","$pass") or die("Cannot connect");
            
mysql_select_db($dbname) or die("Cannot select your database");
        }
    }
    
    
    
// THE ACTUAL DATABASE OPERATIONS 
    // The query() function, used to query the database information.    /dblink->query($query);
    
function query($query){
        
$this->_query $query;
        return 
mysql_query($query,$this->link) or die(mysql_error());
    }
    
    
// Check and see what the last query was for debugging reasons.        $dblink->lastquery();
    
function lastquery(){
        return 
$_query;
    }
    
    
// Get the query array from the database.                            $dblink->fetch_array($result);
    
function fetch_array($result){
        return 
mysql_fetch_array($result);
    }
    
    
// Get the number of rows from the result set.                        $dblink->num_rows($result);
    
function num_rows($result){
        return 
mysql_num_rows($result);
    }
    
    
// Get the number of rows affected by the SQL query.                $dblink->affected_rows();
    
function affected_rows(){
        return 
mysql_affected_rows($this->link);
    }
    
    
// Get the row number from an array, using the result data.            $dblink->fetch_row($result);
    
function fetch_row($result){
        return 
mysql_fetch_row($result);
    }
    
    
// Get the version of the SQL system.                                $dblink->version();
    
function version(){
        return 
mysql_get_server_info($this->link);
    }
    
    
// Destroy the database connection                                    $dblink->destroy();
    
function destroy(){
        
mysql_close($this->link);
    }

so using that as a guideline, if you wish to, help create another database system class. Also any critique on the code would be good, let me know if you find any bugs.

If you're interested in helping, email us at uxcms, or visit our website (not up yet :\) at http://uxcms.unerror.com

Thanks;
enmand