Patch by Timm Friebe <thekid@php.net> with some doc-improvements.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@120990 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sander Roobol 2003-03-23 17:23:25 +00:00
parent e9c8afa7db
commit 73ac11e3a1
4 changed files with 166 additions and 20 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
<refentry id="function.sybase-fetch-array">
<refnamediv>
@ -27,9 +27,51 @@
slower than using <function>sybase_fetch_row</function>, while it
provides a significant added value.
</para>
<note>
<para> When selecting fields with identical names (for instance, in
a join), the associative indices will have a sequential number prepended.
See the example for details.
</para>
</note>
<example>
<title>Identical fieldnames</title>
<programlisting role="php">
<![CDATA[
<?php
$dbh= sybase_connect('SYBASE', '', '');
$q= sybase_query(
'SELECT * FROM p, a WHERE p.person_id= a.person_id',
$dbh
);
var_dump(sybase_fetch_array($q));
sybase_close($dbh);
?>
]]>
</programlisting>
<para>
The above example would produce the following output (assuming the two tables only
have each one column called "person_id"):
</para>
<screen>
<![CDATA[
array(4) {
[0]=>
int(1)
["person_id"]=>
int(1)
[1]=>
int(1)
["person_id1"]=>
int(1)
}
]]>
</screen>
</example>
<para>
For further details, also see
<function>sybase_fetch_row</function>.
<function>sybase_fetch_row</function>,
<function>sybase_fetch_assoc</function> and
<function>sybase_fetch_object</function>.
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
<refentry id="function.sybase-fetch-object">
<refnamediv>
@ -11,25 +11,80 @@
<methodsynopsis>
<type>int</type><methodname>sybase_fetch_object</methodname>
<methodparam><type>int</type><parameter>result</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>object</parameter></methodparam>
</methodsynopsis>
<para> Returns: An object with properties that correspond to the
fetched row, or &false; if there are no more rows.
<para>
Returns: An object with properties that correspond to the
fetched row, or &false; if there are no more rows.
</para>
<para>
<function>sybase_fetch_object</function> is similar to
<function>sybase_fetch_array</function>, with one difference - an
object is returned, instead of an array. Indirectly, that means
that you can only access the data by the field names, and not by
their offsets (numbers are illegal property names).</para>
<function>sybase_fetch_assoc</function>, with one difference - an object
is returned, instead of an array.
</para>
<para>
Speed-wise, the function is identical to
<function>sybase_fetch_array</function>, and almost as quick as
<function>sybase_fetch_row</function> (the difference is
insignificant).
Use the second <parameter>object</parameter> to specify the type of object
you want to return. If this parameter is omitted, the object will be of
type stdClass.
</para>
<note>
<para>
As of PHP 4.3.0, this function will no longer return numeric object members.
</para>
<para>
Old behaviour:
<screen>
<![CDATA[
object(stdclass)(3) {
[0]=>
string(3) "foo"
["foo"]=>
string(3) "foo"
[1]=>
string(3) "bar"
["bar"]=>
string(3) "bar"
}
]]>
</screen>
New behaviour:
<screen>
<![CDATA[
object(stdclass)(3) {
["foo"]=>
string(3) "foo"
["bar"]=>
string(3) "bar"
}
]]>
</screen>
</para>
</note>
<example>
<title><function>sybase_fetch_object</function> return as Foo</title>
<programlisting role="php">
<![CDATA[
<?php
class Foo {
var $foo, $bar, $baz;
}
// {...]
$qrh= sybase_query('SELECT foo, bar, baz FROM example');
$foo= sybase_fetch_object($qrh, 'Foo');
$bar= sybase_fetch_object($qrh, new Foo());
// {...]
?>
]]>
</programlisting>
</example>
<para>
Speed-wise, the function is identical to
<function>sybase_fetch_array</function>, and almost as quick as
<function>sybase_fetch_row</function> (the difference is insignificant).
</para>
<para>
See also
<function>sybase_fetch_array</function>, and
See also <function>sybase_fetch_array</function>, and
<function>sybase_fetch_row</function>.
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/sybase.xml, last change in rev 1.2 -->
<refentry id="function.sybase-fetch-row">
<refnamediv>
@ -12,8 +12,9 @@
<type>array</type><methodname>sybase_fetch_row</methodname>
<methodparam><type>int</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para> Returns: An array that corresponds to the fetched row, or
&false; if there are no more rows.
<para>
Returns: An array that corresponds to the fetched row, or
&false; if there are no more rows.
</para>
<para>
<function>sybase_fetch_row</function> fetches one row of data
@ -26,8 +27,38 @@
return the next row in the result set, or &false; if there are no
more rows.
</para>
<table>
<title>Data types</title>
<tgroup cols="2">
<thead>
<row>
<entry>PHP</entry>
<entry>Sybase</entry>
</row>
</thead>
<tbody>
<row>
<entry>string</entry>
<entry>VARCHAR, TEXT, CHAR, IMAGE, BINARY, VARBINARY, DATETIME</entry>
</row>
<row>
<entry>int</entry>
<entry>NUMERIC (w/o precision), DECIMAL (w/o precision), INT, BIT, TINYINT, SMALLINT</entry>
</row>
<row>
<entry>float</entry>
<entry>NUMERIC (w/ precision), DECIMAL (w/ precision), REAL, FLOAT, MONEY</entry>
</row>
<row>
<entry>&null;</entry>
<entry>NULL</entry>
</row>
</tbody>
</tgroup>
</table>
<para>
See also <function>sybase_fetch_array</function>,
See also: <function>sybase_fetch_array</function>,
<function>sybase_fetch_assoc</function>,
<function>sybase_fetch_object</function>,
<function>sybase_data_seek</function>,
<function>sybase_fetch_lengths</function>, and

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<section id="sybase.configuration">
&reftitle.runtime;
&extension.runtime;
@ -212,6 +212,11 @@
<entry>NULL</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>sybct.deadlock_retry_count</entry>
<entry>"-1"</entry>
<entry>PHP_INI_ALL</entry>
</row>
</tbody>
</tgroup>
</table>
@ -339,6 +344,19 @@
</listitem>
</varlistentry>
<varlistentry id="ini.sybct.deadlock-retry-count">
<term>
<parameter>sybct.deadlock_retry_count</parameter>
<type>int</type>
</term>
<listitem>
<para>
Allows you to to define how often deadlocks are to be retried. The default
is -1, or "forever".
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>