php man page for db2_result

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 set

SYNOPSIS
mixed db2_result (resource $stmt, mixed $column)
DESCRIPTION
Use 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.
PARAMETERS
o $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 VALUES
Returns 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.
EXAMPLES
Example #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 Ride
SEE ALSO
db2_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
db2_exec(3) - php
db2_fetch_row(3) - php
db2_fetch_assoc(3) - php
db2_bind_param(3) - php
db2_fetch_object(3) - php
Similar Topics in the Unix Linux Community
sql in shell script
List of common identifiers
Problem comparing String using IF stmt
comparing column of two different files and print the column from in order of 2nd file
Print particular string in a field of csv file