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

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

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

        // Bind data
        static::$adapter->bind($pdostatement, $data);

        // Execute query
        $pdostatement->execute();

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

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

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

        // Bind data
        static::$adapter->bind($pdostatement, $data);

        // Execute query
        $pdostatement->execute();

        return Sanitize::make($pdostatement->fetch());
    }
public static function selectOne ( $ sqlstatement , array $ data = [ ] ) { static :: verifyConnection ( ) ; if ( ! preg_match ( "/^select\s.+?\sfrom\s.+;?$/i" , $ sqlstatement ) ) { throw new DatabaseException ( 'Syntax Error on the Request' , E_USER_ERROR ) ; } // Prepare query $ pdostatement = static :: $ adapter -> getConnection ( ) -> prepare ( $ sqlstatement ) ; // Bind data static :: $ adapter -> bind ( $ pdostatement , $ data ) ; // Execute query $ pdostatement -> execute ( ) ; return Sanitize :: make ( $ pdostatement -> fetch ( ) ) ; }
Executes a select query and returns a single record

@param  string $sqlstatement
@param  array  $data
@return mixed|null
Executes a select query and returns a single record