odbx_column_count(3)

NAME
odbx_column_count - Get the number of columns in the current result set

SYNOPSIS
\FC#include <opendbx/api.h>\F[]

\FCint odbx_column_count\F[]
\FC(odbx_result_t* result);\F[]

DESCRIPTION
Returns the number of columns which belongs to the current result set allocated by \FCodbx_result\F[](). The number will never change within a result set with one notable exception: MySQL returns all outstanding rows of a previous result set first if they were not fetched completely by \FCodbx_row_fetch\F[]() before. Therefore, the column count might change in this special situation. It is strongly advised to fetch all rows of a result set before calling \FCodbx_result\F[]() again because other backends will return an error in this case.

The \FCresult\F[] parameter required by this function must be a valid result set returned by \FCodbx_result\F[]() and must not has been feed to \FCodbx_result_finish\F[]() before.

RETURN VALUE
\FCodbx_column_count\F[]() returns the number of columns/fields which are available in the current result set. The value depends on the column list being part of the SELECT query and it is zero if the query wasn't a SELECT-like query.

ERRORS
This function will also return zero if the \FCresult\F[] parameter is invalid.

SEE ALSO
\FCodbx_column_name\F[](), \FCodbx_column_type\F[](), \FCodbx_result\F[]()