irm-1.6-b3/MDB/Modules/Manager/fbsql.php
/**
     * list all fields in a tables in the current database
     *
     * @param object    $dbs        database object that is extended by this class
     * @param string $table name of table that should be used in method
     * @return mixed data array on success, a MDB error on failure
     * @access public
     */
list all fields in a tables in the current database
@param object    $dbs        database object that is extended by this class
@param string $table name of table that should be used in method
@return mixed data array on success, a MDB error on failure
@access public
list all fields in a tables in the current database @param object $dbs database object that is extended by this class @param string $table name of table that should be used in method @return mixed data array on success a MDB error on failure @access public
function listTableFields(&$db, $table)
    {
        $result = $db->query("SHOW COLUMNS FROM $table");
        if(MDB::isError($result)) {
            return($result);
        }
        $columns = $db->getColumnNames($result);
        if(MDB::isError($columns)) {
            $db->freeResult($columns);
            return($columns);
        }
        if(!isset($columns['field'])) {
            $db->freeResult($result);
            return($db->raiseError(MDB_ERROR_MANAGER, NULL, NULL,
                'List table fields: show columns does not return the table field names'));
        }
        $field_column = $columns['field'];
        for($fields = array(), $field = 0; !$db->endOfResult($result); ++$field) {
            $field_name = $db->fetch($result, $field, $field_column);
            if ($field_name != $db->dummy_primary_key)
                $fields[] = $field_name;
        }
        $db->freeResult($result);
        return($fields);
    }
function listTableFields ( & $ db , $ table ) { $ result = $ db -> query ( " SHOW COLUMNS FROM  $ table " ) ; if ( MDB :: isError ( $ result ) ) { return ( $ result ) ; } $ columns = $ db -> getColumnNames ( $ result ) ; if ( MDB :: isError ( $ columns ) ) { $ db -> freeResult ( $ columns ) ; return ( $ columns ) ; } if ( ! isset ( $ columns [ 'field' ] ) ) { $ db -> freeResult ( $ result ) ; return ( $ db -> raiseError ( MDB_ERROR_MANAGER , NULL , NULL , 'List table fields: show columns does not return the table field names' ) ) ; } $ field_column = $ columns [ 'field' ] ; for ( $ fields = array ( ) , $ field = 0 ; ! $ db -> endOfResult ( $ result ) ; ++ $ field ) { $ field_name = $ db -> fetch ( $ result , $ field , $ field_column ) ; if ( $ field_name != $ db -> dummy_primary_key ) $ fields [ ] = $ field_name ; } $ db -> freeResult ( $ result ) ; return ( $ fields ) ; }
list all fields in a tables in the current database
 @param object    $dbs        database object that is extended by this class
 @param string $table name of table that should be used in method
 @return mixed data array on success, a MDB error on failure
 @access public
list all fields in a tables in the current database @param object $dbs database object that is extended by this class @param string $table name of table that should be used in method @return mixed data array on success a MDB error on failure @access public