Switch to: V11V10V9V8V7V6V5



string valentina_field_type ( 
                  resource result, 
                  int field_offset )


Name Description
result The result resource that is being evaluated. This result comes from a call to valentina_query().
field_offset The numerical field offset. The field_offset starts at 0. If field_offset does not exist, an error of level E_WARNING is also issued.


The call is similar to the valentina_field_name() function. The arguments are identical, but the field type is returned instead of field name.

Return Values

The returned field type will be one of “int”, “string”, “blob”, and others as detailed in the VServer documentation.


Example 1.

valentina_connect("localhost", "val_username", "val_password");
$result = valentina_query("SELECT * FROM func");
$fields = valentina_num_fields($result);
$rows  = valentina_num_rows($result);
$table  = valentina_field_table($result, 0);
echo "Your '" . $table . "' table has " . $fields . " fields and " . $rows . " record(s)\n";
echo "The table has the following fields:\n";
for ($i=0; $i < $fields; $i++) {
   $type  = valentina_field_type($result, $i);
   $name  = valentina_field_name($result, $i);
   $len  = valentina_field_len($result, $i);
   $flags = valentina_field_flags($result, $i);
   echo $type . " " . $name . " " . $len . " " . $flags . "\n";

The above example will output something similar to:

Your 'func' table has 4 fields and 1 record(s)
The table has the following fields:
string name 64 not_null primary_key binary
int ret 1 not_null
string dl 128 not_null
string type 9 not_null enum


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