irm-1.6-b3/MDB/Modules/Manager/fbsql.php
/**
     * get the stucture of a field into an array
     *
     * @param object    $dbs        database object that is extended by this class
     * @param string    $table         name of the table on which the index is to be created
     * @param string    $name         name of the index to be created
     * @param array     $definition        associative array that defines properties of the index to be created.
     *                                 Currently, only one property named FIELDS is supported. This property
     *                                 is also an associative with the names of the index fields as array
     *                                 indexes. Each entry of this array is set to another type of associative
     *                                 array that specifies properties of the index that are specific to
     *                                 each field.
     *
     *                                Currently, only the sorting property is supported. It should be used
     *                                 to define the sorting direction of the index. It may be set to either
     *                                 ascending or descending.
     *
     *                                Not all DBMS support index sorting direction configuration. The DBMS
     *                                 drivers of those that do not support it ignore this property. Use the
     *                                 function support() to determine whether the DBMS driver can manage indexes.

     *                                 Example
     *                                    array(
     *                                        'FIELDS' => array(
     *                                            'user_name' => array(
     *                                                'sorting' => 'ascending'
     *                                            ),
     *                                            'last_login' => array()
     *                                        )
     *                                    )
     * @return mixed MDB_OK on success, a MDB error on failure
     * @access public
     */
get the stucture of a field into an array
@param object    $dbs        database object that is extended by this class
@param string    $table         name of the table on which the index is to be created
@param string    $name         name of the index to be created
@param array     $definition        associative array that defines properties of the index to be created.
Currently, only one property named FIELDS is supported. This property
is also an associative with the names of the index fields as array
indexes. Each entry of this array is set to another type of associative
array that specifies properties of the index that are specific to
each field.

Currently, only the sorting property is supported. It should be used
to define the sorting direction of the index. It may be set to either
ascending or descending.

Not all DBMS support index sorting direction configuration. The DBMS
drivers of those that do not support it ignore this property. Use the
function support() to determine whether the DBMS driver can manage indexes.


get the stucture of a field into an array @param object $dbs database object that is extended by this class @param string $table name of the table on which the index is to be created @param string $name name of the index to be created @param array $definition associative array that defines properties of the index to be created . Currently only one property named FIELDS is supported . This property is also an associative with the names of the index fields as array indexes . Each entry of this array is set to another type of associative array that specifies properties of the index that are specific to each field . Currently only the sorting property is supported . It should be used to define the sorting direction of the index . It may be set to either ascending or descending . Not all DBMS support index sorting direction configuration . The DBMS drivers of those that do not support it ignore this property . Use the function support () to determine whether the DBMS driver can manage indexes .
function createIndex(&$db, $table, $name, $definition)
    {
        $query = "CREATE ".(isset($definition['unique']) ? 'UNIQUE INDEX' : 'INDEX')." $name on $table (";
        for($field = 0, reset($definition['FIELDS']);
            $field < count($definition['FIELDS']);
            $field++, next($definition['FIELDS']))
        {
            if ($field > 0) {
                $query .= ',';
            }
            $query .= key($definition['FIELDS']);
        }
        $query .= ')';
        return($db->query($query));
    }
function createIndex ( & $ db , $ table , $ name , $ definition ) { $ query = " CREATE  " . ( isset ( $ definition [ 'unique' ] ) ? 'UNIQUE INDEX' : 'INDEX' ) . " $ name  on  $ table  ( " ; for ( $ field = 0 , reset ( $ definition [ 'FIELDS' ] ) ; $ field < count ( $ definition [ 'FIELDS' ] ) ; $ field ++ , next ( $ definition [ 'FIELDS' ] ) ) { if ( $ field > 0 ) { $ query .= ',' ; } $ query .= key ( $ definition [ 'FIELDS' ] ) ; } $ query .= ')' ; return ( $ db -> query ( $ query ) ) ; }
get the stucture of a field into an array
 @param object    $dbs        database object that is extended by this class
 @param string    $table         name of the table on which the index is to be created
 @param string    $name         name of the index to be created
 @param array     $definition        associative array that defines properties of the index to be created.
get the stucture of a field into an array @param object $dbs database object that is extended by this class @param string $table name of the table on which the index is to be created @param string $name name of the index to be created @param array $definition associative array that defines properties of the index to be created .