irm-1.6-b3/MDB/Modules/Manager/fbsql.php
/**
     * create a new table
     *
     * @param object    $dbs        database object that is extended by this class
     * @param string $name     Name of the database that should be created
     * @param array $fields Associative array that contains the definition of each field of the new table
     *                        The indexes of the array entries are the names of the fields of the table an
     *                        the array entry values are associative arrays like those that are meant to be
     *                         passed with the field definitions to get[Type]Declaration() functions.
     *
     *                        Example
     *                        array(
     *
     *                            'id' => array(
     *                                'type' => 'integer',
     *                                'unsigned' => 1
     *                                'notnull' => 1
     *                                'default' => 0
     *                            ),
     *                            'name' => array(
     *                                'type' => 'text',
     *                                'length' => 12
     *                            ),
     *                            'password' => array(
     *                                'type' => 'text',
     *                                'length' => 12
     *                            )
     *                        );
     * @return mixed MDB_OK on success, a MDB error on failure
     * @access public
     */
create a new table
@param object    $dbs        database object that is extended by this class
@param string $name     Name of the database that should be created
@param array $fields Associative array that contains the definition of each field of the new table
The indexes of the array entries are the names of the fields of the table an
the array entry values are associative arrays like those that are meant to be
passed with the field definitions to get[Type]Declaration() functions.

Example
array(


create a new table @param object $dbs database object that is extended by this class @param string $name Name of the database that should be created @param array $fields Associative array that contains the definition of each field of the new table The indexes of the array entries are the names of the fields of the table an the array entry values are associative arrays like those that are meant to be passed with the field definitions to get [ Type ] Declaration () functions . Example array (
function createTable(&$db, $name, $fields)
    {
        if (!isset($name) || !strcmp($name, '')) {
            return($db->raiseError(MDB_ERROR_CANNOT_CREATE, NULL, NULL, 'no valid table name specified'));
        }
        if (count($fields) == 0) {
            return($db->raiseError(MDB_ERROR_CANNOT_CREATE, NULL, NULL, 'no fields specified for table "'.$name.'"'));
        }
        if (MDB::isError($query_fields = $db->getFieldDeclarationList($fields))) {
            return($db->raiseError(MDB_ERROR_CANNOT_CREATE, NULL, NULL, 'unkown error'));
        }
        $query = "CREATE TABLE $name ($query_fields)";
        return($db->query($query));
    }
function createTable ( & $ db , $ name , $ fields ) { if ( ! isset ( $ name ) || ! strcmp ( $ name , '' ) ) { return ( $ db -> raiseError ( MDB_ERROR_CANNOT_CREATE , NULL , NULL , 'no valid table name specified' ) ) ; } if ( count ( $ fields ) == 0 ) { return ( $ db -> raiseError ( MDB_ERROR_CANNOT_CREATE , NULL , NULL , 'no fields specified for table "' . $ name . '"' ) ) ; } if ( MDB :: isError ( $ query_fields = $ db -> getFieldDeclarationList ( $ fields ) ) ) { return ( $ db -> raiseError ( MDB_ERROR_CANNOT_CREATE , NULL , NULL , 'unkown error' ) ) ; } $ query = " CREATE TABLE  $ name  ( $ query_fields ) " ; return ( $ db -> query ( $ query ) ) ; }
create a new table
 @param object    $dbs        database object that is extended by this class
 @param string $name     Name of the database that should be created
 @param array $fields Associative array that contains the definition of each field of the new table
                        The indexes of the array entries are the names of the fields of the table an
                        the array entry values are associative arrays like those that are meant to be
                         passed with the field definitions to get[Type]Declaration() functions.
create a new table @param object $dbs database object that is extended by this class @param string $name Name of the database that should be created @param array $fields Associative array that contains the definition of each field of the new table The indexes of the array entries are the names of the fields of the table an the array entry values are associative arrays like those that are meant to be passed with the field definitions to get [ Type ] Declaration () functions .