SwatDB/SwatDB.php
public static function getFieldMax($db, $table, $field)
    {
        $field = new SwatDBField($field, 'integer');

        $sql = sprintf(
            'select max(%s) as %s from %s',
            $field->name,
            $field->name,
            $table
        );

        return self::queryOne($db, $sql);
    }
public static function getFieldMax($db, $table, $field)
    {
        $field = new SwatDBField($field, 'integer');

        $sql = sprintf(
            'select max(%s) as %s from %s',
            $field->name,
            $field->name,
            $table
        );

        return self::queryOne($db, $sql);
    }
public static function getFieldMax ( $ db , $ table , $ field ) { $ field = new SwatDBField ( $ field , 'integer' ) ; $ sql = sprintf ( 'select max(%s) as %s from %s' , $ field -> name , $ field -> name , $ table ) ; return self :: queryOne ( $ db , $ sql ) ; }
Get max field value

Convenience method to grab the max value from a single field.

@param MDB2_Driver_Common $db The database connection.

@param string $table The database table to update.

@param string $field The field to be return the max value of. Can be
given in the form type:name where type is a standard MDB2
datatype. If type is ommitted, then text is assummed.

@return mixed The max value of field specified.

@throws SwatDBException
Get max field value