public function record_exists_sql($sql, array $params=null) {
        $mrs = $this->get_recordset_sql($sql, $params, 0, 1);
        $return = $mrs->valid();
        $mrs->close();
        return $return;
    }
public function record_exists_sql($sql, array $params=null) {
        $mrs = $this->get_recordset_sql($sql, $params, 0, 1);
        $return = $mrs->valid();
        $mrs->close();
        return $return;
    }
public function record_exists_sql ( $ sql , array $ params = null ) { $ mrs = $ this -> get_recordset_sql ( $ sql , $ params , 0 , 1 ) ; $ return = $ mrs -> valid ( ) ; $ mrs -> close ( ) ; return $ return ; }
Test whether a SQL SELECT statement returns any records.

This function returns true if the SQL statement executes
without any errors and returns at least one record.

@param string $sql The SQL statement to execute.
@param array $params array of sql parameters
@return bool true if the SQL executes without errors and returns at least one record.
@throws dml_exception A DML specific exception is thrown for any errors.
Test whether a SQL SELECT statement returns any records .