public static function select($sqlstatement, array $data = [])
    {
        static::verifyConnection();

        if (!preg_match(
            "/^(select\s.+?\sfrom\s.+;?|desc\s.+;?)$/i",
            $sqlstatement
        )) {
            throw new DatabaseException(
                'Syntax Error on the Request',
                E_USER_ERROR
            );
        }

        $pdostatement = static::$adapter
            ->getConnection()
            ->prepare($sqlstatement);

        static::$adapter->bind(
            $pdostatement,
            Sanitize::make($data, true)
        );

        $pdostatement->execute();

        return Sanitize::make($pdostatement->fetchAll());
    }
public static function select($sqlstatement, array $data = [])
    {
        static::verifyConnection();

        if (!preg_match(
            "/^(select\s.+?\sfrom\s.+;?|desc\s.+;?)$/i",
            $sqlstatement
        )) {
            throw new DatabaseException(
                'Syntax Error on the Request',
                E_USER_ERROR
            );
        }

        $pdostatement = static::$adapter
            ->getConnection()
            ->prepare($sqlstatement);

        static::$adapter->bind(
            $pdostatement,
            Sanitize::make($data, true)
        );

        $pdostatement->execute();

        return Sanitize::make($pdostatement->fetchAll());
    }
public static function select ( $ sqlstatement , array $ data = [ ] ) { static :: verifyConnection ( ) ; if ( ! preg_match ( "/^(select\s.+?\sfrom\s.+;?|desc\s.+;?)$/i" , $ sqlstatement ) ) { throw new DatabaseException ( 'Syntax Error on the Request' , E_USER_ERROR ) ; } $ pdostatement = static :: $ adapter -> getConnection ( ) -> prepare ( $ sqlstatement ) ; static :: $ adapter -> bind ( $ pdostatement , Sanitize :: make ( $ data , true ) ) ; $ pdostatement -> execute ( ) ; return Sanitize :: make ( $ pdostatement -> fetchAll ( ) ) ; }
Execute a SELECT request

@param  string $sqlstatement
@param  array        $data
@return mixed|null
Execute a SELECT request