Documentation

CDBResult class

CDBResult - class represents the result of a database query.

The class contains methods that can be used to implement the pagewise navigation and handle query results. An instance of this class is created automatically and returned by the CDatabase::Query method.

Class properties

Property Description
result Result descriptor.
arResult Array-based result (available only after calling CDBResult::NavStart). This property contains unformatted data: for example, a date of the  "date/time" property type for the information block element. It's recommended to use CDBresult::Fetch, CDBresult::GetNext to handle the object.
NavRecordCount Number of records (available only after calling CDBResult::NavStart).
NavPageCount Number of pages (available only after calling CDBResult::NavStart).
NavPageNomer Number of the current page in the pagewise navigation sequence (available only after calling NavStart).
NavPageSize Size of a page (available only after calling CDBResult::NavStart).
bFirstPrintNavEquals "true" if the CDBResult::NavPrint method was called once (available only after calling CDBResult::NavStart).
bShowAll Specifies ("true"|"false") the link "All" is to be displayed in the pagewise navigation screen (available only after calling CDBResult::NavStart).
NavShowAll If "true", the current screen displays all records as opposed to pagewise display (i.e. a user clicked the All link) (available only after calling CDBResult::NavStart).
NavNum Current page ordinal used with the pagewise navigation mode (available only after calling CDBResult::NavStart).
nStartPage Equals "true", if the first page is currently displayed via the pagewise navigation (available only after calling CDBResult::NavStart).
nEndPage Equals "true", if the last page is currently displayed (available only after calling CDBResult::NavStart).

Class methods

Method Description Available from version
Fetch Retrieves field values and stores them in an array.
NavNext Returns an array of field values.
NavPrint Displays page navigation links.
NavStart Splits the retrieved result into pages
NavStringForCache Returns the string which uniquely identify the current state of pagewise navigation (current page number, whether the "All" links was activated via click).
IsNavPrint Determines if all records may fit in a single page during pagewise navigation.
GetNext Returns an array of field values converted to the HTML safe format.
ExtractFields Defines global variables with corresponding field names.
FieldName Returns a field name by its ordinal.
FieldsCount Returns the number of fields in the retrieved selection.
SelectedRowsCount Returns the number of records specified via SELECT.
AffectedRowsCount Returns a number of records modified by executing such SQL commands as INSERT, UPDATE or DELETE.
InitFromArray Initializes the instance of CDBResult with the supplied values.
GetPageNavString
GetPageNavStringEx Returns pagewise navigation panel in the HTML format.


© «Bitrix24», 2001-2024
Up