PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




ocifetchinto

Name

ocifetchinto — Fetch a row of result data into an array

Synopsis

int ocifetchinto(stmt, &result[, mode]);
int stmt: Statement handler
array &result:
int mode (optional): mode explanation goes here

Returns

Next result array or FALSE on error

Description

Fetches the next row of data from an executed query into an array specified by result .

The behaviour of ocifetchinto() can be modified by specifying different values for mode. By default the result array will only contain values frm columns that do not contain NULL values. This can be modified setting the mode to OCI_RETURN_NULLS. Other available modes are:

OCI_ASSOC Return an associative array
OCI_NUM Return an numbered array starting with one (default)
OCI_RETURN_NULLS Return empty columns
OCI_RETURN_LOBS Return the value of a LOB instead of the descriptor
You can specify more than one flag by simply adding them up (eg OCI_ASSOC+OCI_RETURN_NULLS).

Version

Since versions 3.0.4 and 4.0

Example

Example 858. Get number of rows in a table

if (!$db = @ocinlogon("dev","dev", "ORCL")) {
    $error = ocierror();
    printf("CONNECT error: %s", $error["message"]);
    die();
}
    $sql = "SELECT count (*) FROM phone_numbers";
    ociexecute($stmt);
    ocifetchinto($stmt, $result);
    echo "Number of rows: ".$result[0];



PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.