dbQueryCols#

Purpose#

Returns the number of fields in the record.

Format#

num_fields = dbQueryCols(qid)#
Parameters:

qid (scalar) – query number.

Returns:

num_fields (scalar) – number of fields.

Examples#

// Execute a query
qid = dbExecQuery(db_id, "SELECT id, name, price FROM products");

// Get the number of fields in the result set
num_fields = dbQueryCols(qid);

// Should print 3
print (num_fields);