Switch to: V11V10V9V8V7V6V5

valentina_num_fields()

Declaration

int valentina_num_fields ( resource result )

Parameters

Name Description
result The result resource that is being evaluated. This result comes from a call to valentina_query().

Description

Retrieves the number of fields in a result set.

Return Values

Returns the number of fields in the result set resource on success, or FALSE on failure.

Examples

Example 1.

<?php
$result = valentina_query("SELECT id,email FROM people WHERE id = '42'");
if (!$result) {
   echo 'Could not run query: ' . valentina_error();
   exit;
}
 
/* returns 2 because id,email === two fields */
echo valentina_num_fields($result);
?> 

Notes

Note: For downward compatibility, the following deprecated alias may be used: valentina_numfields()

See Also