cvs: phpdoc /en/reference/sybase ini.xml /en/reference/sybase/functions sybase-fetch-array.xml sybase-fetch-object.xml sybase-fetch-row.xml

From: Date: Sun, 23 Mar 2003 17:23:26 +0000
Subject: cvs: phpdoc /en/reference/sybase ini.xml /en/reference/sybase/functions sybase-fetch-array.xml sybase-fetch-object.xml sybase-fetch-row.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969352297@lists.php.net to get a copy of this message
sander Sun Mar 23 12:23:26 2003 EDT Modified files: /phpdoc/en/reference/sybase ini.xml /phpdoc/en/reference/sybase/functions sybase-fetch-array.xml sybase-fetch-object.xml sybase-fetch-row.xml Log: Patch by Timm Friebe <thekid@php.net> with some doc-improvements.

Index: phpdoc/en/reference/sybase/ini.xml diff -u phpdoc/en/reference/sybase/ini.xml:1.4 phpdoc/en/reference/sybase/ini.xml:1.5 --- phpdoc/en/reference/sybase/ini.xml:1.4 Thu Nov 14 08:03:21 2002 +++ phpdoc/en/reference/sybase/ini.xml Sun Mar 23 12:23:24 2003 @@ -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> @@ -335,6 +340,19 @@ <para> The name of the host you claim to be connecting from, for display by sp_who. The default is none. + </para> + </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> Index: phpdoc/en/reference/sybase/functions/sybase-fetch-array.xml diff -u phpdoc/en/reference/sybase/functions/sybase-fetch-array.xml:1.2 phpdoc/en/reference/sybase/functions/sybase-fetch-array.xml:1.3 --- phpdoc/en/reference/sybase/functions/sybase-fetch-array.xml:1.2 Wed Apr 17 02:44:40 2002 +++ phpdoc/en/reference/sybase/functions/sybase-fetch-array.xml Sun Mar 23 12:23:25 2003 @@ -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> Index: phpdoc/en/reference/sybase/functions/sybase-fetch-object.xml diff -u phpdoc/en/reference/sybase/functions/sybase-fetch-object.xml:1.3 phpdoc/en/reference/sybase/functions/sybase-fetch-object.xml:1.4 --- phpdoc/en/reference/sybase/functions/sybase-fetch-object.xml:1.3 Wed Feb 19 17:10:28 2003 +++ phpdoc/en/reference/sybase/functions/sybase-fetch-object.xml Sun Mar 23 12:23:25 2003 @@ -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> + 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). + 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> Index: phpdoc/en/reference/sybase/functions/sybase-fetch-row.xml diff -u phpdoc/en/reference/sybase/functions/sybase-fetch-row.xml:1.3 phpdoc/en/reference/sybase/functions/sybase-fetch-row.xml:1.4 --- phpdoc/en/reference/sybase/functions/sybase-fetch-row.xml:1.3 Wed Feb 19 17:10:28 2003 +++ phpdoc/en/reference/sybase/functions/sybase-fetch-row.xml Sun Mar 23 12:23:25 2003 @@ -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
« previous php.doc (#969352297) next »