Query: db2_result
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
DB2_RESULT(3) 1 DB2_RESULT(3) db2_result - Returns a single column from a row in the result setSYNOPSISmixed db2_result (resource $stmt, mixed $column)DESCRIPTIONUse db2_result(3) to return the value of a specified column in the current row of a result set. You must call db2_fetch_row(3) before calling db2_result(3) to set the location of the result set pointer.PARAMETERSo $stmt - A valid stmt resource. o $column - Either an integer mapping to the 0-indexed field in the result set, or a string matching the name of the column.RETURN VALUESReturns the value of the requested field if the field exists in the result set. Returns NULL if the field does not exist, and issues a warning.EXAMPLESExample #1 A db2_result(3) example The following example demonstrates how to iterate through a result set with db2_fetch_row(3) and retrieve columns from the result set with db2_result(3). <?php $sql = 'SELECT name, breed FROM animals WHERE weight < ?'; $stmt = db2_prepare($conn, $sql); db2_execute($stmt, array(10)); while (db2_fetch_row($stmt)) { $name = db2_result($stmt, 0); $breed = db2_result($stmt, 'BREED'); print "$name $breed"; } ?> The above example will output: cat Pook gold fish Bubbles budgerigar Gizmo goat Rickety RideSEE ALSOdb2_fetch_array(3), db2_fetch_assoc(3), db2_fetch_both(3), db2_fetch_object(3), db2_fetch_row(3). PHP Documentation Group DB2_RESULT(3)
Related Man Pages |
---|
sqlsrv_get_field(3) - php |
db2_fetch_row(3) - php |
pdostatement.bindcolumn(3) - php |
db2_next_result(3) - php |
sqlsrv_next_result(3) - php |
Similar Topics in the Unix Linux Community |
---|
get data from next line |
help:Reading width separated data |
List of common identifiers |
if stmt argument expected error |
Print particular string in a field of csv file |