src/Base.php
public static function findById($id)
    {
        try {
            $tableName = self::getTableName();
            $conn = self::getConnection();

            $stmt = $conn->query('SELECT * FROM '.$tableName.' WHERE id='.$id);

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

            $stmt = $conn->query('SELECT * FROM '.$tableName.' WHERE id='.$id);

            return self::find($stmt);
        }
        catch(PDOException $pe) {
            return $pe->getMessage();
        }
        catch(Exception $e) {
            return $e->getMessage();
        }
    }
public static function findById ( $ id ) { try { $ tableName = self :: getTableName ( ) ; $ conn = self :: getConnection ( ) ; $ stmt = $ conn -> query ( 'SELECT * FROM ' . $ tableName . ' WHERE id=' . $ id ) ; return self :: find ( $ stmt ) ; } catch ( PDOException $ pe ) { return $ pe -> getMessage ( ) ; } catch ( Exception $ e ) { return $ e -> getMessage ( ) ; } }
Finds a record in the database table that has the id passed in as a parameter
@param  integer $id
Finds a record in the database table that has the id passed in as a parameter