Table of Contents
valentina_result()
Declaration
string valentina_result ( resource result, int row, [long fieldOffset] )
Parameters
Name | Description | |
---|---|---|
result | The result resource that is being evaluated. This result comes from a call to valentina_query(). | |
row | The row number from the result that's being retrieved. Row numbers start at 0. | |
field | The offset of the field being retrieved. |
Description
Retrieves the contents of one cell from a VServer result set.
When working on large result sets, you should consider using one of the functions that fetch an entire row (specified below). As these functions return the contents of multiple cells in one function call, they're MUCH quicker than valentina_result().
If no field offset specified - returns the value of the field with offset 0
Note: the declaration differs from the MYSQL. You can only specify the field offset but not the field name.
Return Values
The contents of one cell from a Vserver result set on success, or FALSE on failure.
Examples
Example 1.
<?php $link = valentina_connect('localhost', 'val_user', 'val_password'); if (!$link) { die('Could not connect: ' . valentina_error()); } $result = valentina_query('SELECT name FROM work.employee'); if (!$result) { die('Could not query:' . valentina_error()); } echo valentina_result($result, 2); // outputs third employee's name valentina_close($link); ?>
Notes
NoteCalls to valentina_result() should not be mixed with calls to other functions that deal with the result set.
Performance Again - this function is NOT recommended to use because it returns only one field. Use instead valentina_fetch_array(), or others, returning the entire row.