src/Base.php
public static function findByPosition($position)
    {
        try {
            $offset = $position - 1;
            $tableName = self::getTableName();
            $conn = self::getConnection();

            $stmt = $conn->query('SELECT * FROM '.$tableName.' LIMIT '.$offset.', 1'); //mysql syntax
            if(! $stmt) {
                $stmt = $conn->query('SELECT * FROM '.$tableName.' OFFSET '.$offset.' LIMIT 1'); //pgsql syntax
            }

            return self::find($stmt);;
        }
        catch(PDOException $pe) {
            return $pe->getMessage();
        }
        catch(Exception $e) {
            return $e->getMessage();
        }
    }
public static function findByPosition($position)
    {
        try {
            $offset = $position - 1;
            $tableName = self::getTableName();
            $conn = self::getConnection();

            $stmt = $conn->query('SELECT * FROM '.$tableName.' LIMIT '.$offset.', 1'); //mysql syntax
            if(! $stmt) {
                $stmt = $conn->query('SELECT * FROM '.$tableName.' OFFSET '.$offset.' LIMIT 1'); //pgsql syntax
            }

            return self::find($stmt);;
        }
        catch(PDOException $pe) {
            return $pe->getMessage();
        }
        catch(Exception $e) {
            return $e->getMessage();
        }
    }
public static function findByPosition ( $ position ) { try { $ offset = $ position - 1 ; $ tableName = self :: getTableName ( ) ; $ conn = self :: getConnection ( ) ; $ stmt = $ conn -> query ( 'SELECT * FROM ' . $ tableName . ' LIMIT ' . $ offset . ', 1' ) ; //mysql syntax if ( ! $ stmt ) { $ stmt = $ conn -> query ( 'SELECT * FROM ' . $ tableName . ' OFFSET ' . $ offset . ' LIMIT 1' ) ; //pgsql syntax } return self :: find ( $ stmt ) ; ; } catch ( PDOException $ pe ) { return $ pe -> getMessage ( ) ; } catch ( Exception $ e ) { return $ e -> getMessage ( ) ; } }
Finds a record in the database table in the position denoted by the parameter passed
@param  integer $position
Finds a record in the database table in the position denoted by the parameter passed