mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Change db2_fetch_into() to db2_fetch_array() -- part 1.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@186542 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
554e4bfbec
commit
62f43fa7dc
12 changed files with 35 additions and 35 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-bind-param">
|
||||
<refnamediv>
|
||||
|
@ -150,7 +150,7 @@ db2_bind_param($stmt, 2, "upper_limit", DB2_PARAM_IN);
|
|||
$upper_limit = 15.0;
|
||||
|
||||
if (db2_execute($stmt)) {
|
||||
while ($row = db2_fetch_into($stmt)) {
|
||||
while ($row = db2_fetch_array($stmt)) {
|
||||
print "{$row[0]}, {$row[1]}, {$row[2]}\n";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-exec">
|
||||
<refnamediv>
|
||||
|
@ -168,7 +168,7 @@ $sql = "SELECT name FROM animals
|
|||
if ($conn) {
|
||||
require_once('prepare.inc');
|
||||
$stmt = db2_exec($conn, $sql, array('cursor' => DB2_SCROLLABLE));
|
||||
while ($row = db2_fetch_into($stmt)) {
|
||||
while ($row = db2_fetch_array($stmt)) {
|
||||
print "$row[0]\n";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-execute">
|
||||
<refnamediv>
|
||||
|
@ -28,7 +28,7 @@
|
|||
can retrieve a row as an array from the <literal>stmt</literal> resource
|
||||
using <function>db2_fetch_assoc</function>,
|
||||
<function>db2_fetch_both</function>, or
|
||||
<function>db2_fetch_into</function>. Alternatively, you can use
|
||||
<function>db2_fetch_array</function>. Alternatively, you can use
|
||||
<function>db2_fetch_row</function> to move the result set pointer to the
|
||||
next row and fetch a column at a time from that row with
|
||||
<function>db2_result</function>.
|
||||
|
@ -146,9 +146,9 @@ I have 7 pets!
|
|||
<para>
|
||||
<simplelist>
|
||||
<member><function>db2_exec</function></member>
|
||||
<member><function>db2_fetch_array</function></member>
|
||||
<member><function>db2_fetch_assoc</function></member>
|
||||
<member><function>db2_fetch_both</function></member>
|
||||
<member><function>db2_fetch_into</function></member>
|
||||
<member><function>db2_fetch_row</function></member>
|
||||
<member><function>db2_prepare</function></member>
|
||||
<member><function>db2_result</function></member>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-fetch-assoc">
|
||||
<refnamediv>
|
||||
|
@ -134,8 +134,8 @@ while ($row = db2_fetch_assoc($result, $i)) {
|
|||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>db2_fetch_array</function></member>
|
||||
<member><function>db2_fetch_both</function></member>
|
||||
<member><function>db2_fetch_into</function></member>
|
||||
<member><function>db2_fetch_object</function></member>
|
||||
<member><function>db2_fetch_row</function></member>
|
||||
<member><function>db2_result</function></member>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-fetch-both">
|
||||
<refnamediv>
|
||||
|
@ -23,7 +23,7 @@
|
|||
row in a result set. Note that the row returned by
|
||||
<function>db2_fetch_both</function> requires more memory than the
|
||||
single-indexed arrays returned by <function>db2_fetch_assoc</function> or
|
||||
<function>db2_fetch_into</function>.
|
||||
<function>db2_fetch_array</function>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
@ -141,8 +141,8 @@ while ($row = db2_fetch_both($result, $i)) {
|
|||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>db2_fetch_array</function></member>
|
||||
<member><function>db2_fetch_assoc</function></member>
|
||||
<member><function>db2_fetch_into</function></member>
|
||||
<member><function>db2_fetch_object</function></member>
|
||||
<member><function>db2_fetch_row</function></member>
|
||||
<member><function>db2_result</function></member>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-fetch-into">
|
||||
<refnamediv>
|
||||
<refname>db2_fetch_into</refname>
|
||||
<refname>db2_fetch_array</refname>
|
||||
<refpurpose>
|
||||
Returns an array, indexed by column position, representing a row in a result set
|
||||
</refpurpose>
|
||||
|
@ -11,7 +11,7 @@
|
|||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>db2_fetch_into</methodname>
|
||||
<type>array</type><methodname>db2_fetch_array</methodname>
|
||||
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>row_number</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
@ -65,7 +65,7 @@
|
|||
<example>
|
||||
<title>Iterating through a forward-only cursor</title>
|
||||
<para>
|
||||
If you call <function>db2_fetch_into</function> without a specific row
|
||||
If you call <function>db2_fetch_array</function> without a specific row
|
||||
number, it automatically retrieves the next row in the result set.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
|
@ -76,7 +76,7 @@ $sql = "SELECT id, name, breed, weight FROM animals ORDER BY breed";
|
|||
$stmt = db2_prepare($conn, $sql);
|
||||
$result = db2_execute($stmt, $sql);
|
||||
|
||||
while ($row = db2_fetch_into($result)) {
|
||||
while ($row = db2_fetch_array($result)) {
|
||||
printf ("%-5d %-16s %-32s %10s\n",
|
||||
$row[0], $row[1], $row[2], $row[3]);
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ $sql = "SELECT id, name, breed, weight FROM animals ORDER BY breed";
|
|||
$result = db2_exec($stmt, $sql, array('cursor' => DB2_SCROLLABLE));
|
||||
|
||||
$i=2;
|
||||
while ($row = db2_fetch_into($result, $i)) {
|
||||
while ($row = db2_fetch_array($result, $i)) {
|
||||
printf ("%-5d %-16s %-32s %10s\n",
|
||||
$row[0], $row[1], $row[2], $row[3]);
|
||||
$i = $i + 2;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-fetch-object">
|
||||
<refnamediv>
|
||||
|
@ -119,9 +119,9 @@ Come here, Pook, my little cat!
|
|||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>db2_fetch_array</function></member>
|
||||
<member><function>db2_fetch_assoc</function></member>
|
||||
<member><function>db2_fetch_both</function></member>
|
||||
<member><function>db2_fetch_into</function></member>
|
||||
<member><function>db2_fetch_row</function></member>
|
||||
<member><function>db2_result</function></member>
|
||||
</simplelist>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-fetch-row">
|
||||
<refnamediv>
|
||||
|
@ -31,7 +31,7 @@
|
|||
Rather than calling <function>db2_fetch_row</function> and
|
||||
<function>db2_result</function>, most applications will call one of
|
||||
<function>db2_fetch_assoc</function>, <function>db2_fetch_both</function>,
|
||||
or <function>db2_fetch_into</function> to advance the result set pointer
|
||||
or <function>db2_fetch_array</function> to advance the result set pointer
|
||||
and return a complete row as an array.
|
||||
</para>
|
||||
|
||||
|
@ -109,9 +109,9 @@ goat Rickety Ride
|
|||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>db2_fetch_array</function></member>
|
||||
<member><function>db2_fetch_assoc</function></member>
|
||||
<member><function>db2_fetch_both</function></member>
|
||||
<member><function>db2_fetch_into</function></member>
|
||||
<member><function>db2_fetch_object</function></member>
|
||||
<member><function>db2_result</function></member>
|
||||
</simplelist>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-next-result">
|
||||
<refnamediv>
|
||||
|
@ -74,14 +74,14 @@ if ($conn) {
|
|||
$stmt = db2_exec($conn, 'CALL multiResults()');
|
||||
|
||||
print "Fetching first result set\n";
|
||||
while ($row = db2_fetch_into($stmt)) {
|
||||
while ($row = db2_fetch_array($stmt)) {
|
||||
var_dump($row);
|
||||
}
|
||||
|
||||
print "\nFetching second result set\n";
|
||||
$res = db2_next_result($stmt);
|
||||
if ($res) {
|
||||
while ($row = db2_fetch_into($res)) {
|
||||
while ($row = db2_fetch_array($res)) {
|
||||
var_dump($row);
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ if ($conn) {
|
|||
print "\nFetching third result set\n";
|
||||
$res2 = db2_next_result($stmt);
|
||||
if ($res2) {
|
||||
while ($row = db2_fetch_into($res2)) {
|
||||
while ($row = db2_fetch_array($res2)) {
|
||||
var_dump($row);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-num-rows">
|
||||
<refnamediv>
|
||||
|
@ -31,7 +31,7 @@
|
|||
statement and branches if the number of rows is 0, consider modifying your
|
||||
application to attempt to return the first row with one of
|
||||
<function>db2_fetch_assoc</function>, <function>db2_fetch_both</function>,
|
||||
<function>db2_fetch_into</function>, or <function>db2_fetch_row</function>,
|
||||
<function>db2_fetch_array</function>, or <function>db2_fetch_row</function>,
|
||||
and branch if the fetch function returns &false;.
|
||||
</para>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-result">
|
||||
<refnamediv>
|
||||
|
@ -100,9 +100,9 @@ goat Rickety Ride
|
|||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>db2_fetch_array</function></member>
|
||||
<member><function>db2_fetch_assoc</function></member>
|
||||
<member><function>db2_fetch_both</function></member>
|
||||
<member><function>db2_fetch_into</function></member>
|
||||
<member><function>db2_fetch_object</function></member>
|
||||
<member><function>db2_fetch_row</function></member>
|
||||
</simplelist>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.db2-rollback">
|
||||
<refnamediv>
|
||||
|
@ -78,7 +78,7 @@ $conn = db2_connect($database, $user, $password);
|
|||
|
||||
if ($conn) {
|
||||
$stmt = db2_exec($conn, "SELECT count(*) FROM animals");
|
||||
$res = db2_fetch_into( $stmt );
|
||||
$res = db2_fetch_array( $stmt );
|
||||
echo $res[0] . "\n";
|
||||
|
||||
// Turn AUTOCOMMIT off
|
||||
|
@ -88,14 +88,14 @@ if ($conn) {
|
|||
db2_exec($conn, "DELETE FROM animals");
|
||||
|
||||
$stmt = db2_exec($conn, "SELECT count(*) FROM animals");
|
||||
$res = db2_fetch_into( $stmt );
|
||||
$res = db2_fetch_array( $stmt );
|
||||
echo $res[0] . "\n";
|
||||
|
||||
// Roll back the DELETE statement
|
||||
db2_rollback( $conn );
|
||||
|
||||
$stmt = db2_exec( $conn, "SELECT count(*) FROM animals" );
|
||||
$res = db2_fetch_into( $stmt );
|
||||
$res = db2_fetch_array( $stmt );
|
||||
echo $res[0] . "\n";
|
||||
db2_close($conn);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue