On Sun, 2003-03-23 at 11:48, Sander Roobol wrote:
> If you supply a unified diff, I'll commit it. 

OK. Attached is a unified diff - the three new files which need to be
added can be found at:

http://sitten-polizei.de/php/sybase-fetch-assoc.xml
http://sitten-polizei.de/php/sybase-unbuffered-query.xml
http://sitten-polizei.de/php/sybase-set-message-handler.xml

HTH: Timm
Index: ini.xml
===================================================================
RCS file: /repository/phpdoc/en/reference/sybase/ini.xml,v
retrieving revision 1.4
diff -u -r1.4 ini.xml
--- ini.xml	14 Nov 2002 13:03:21 -0000	1.4
+++ ini.xml	23 Mar 2003 14:31:14 -0000
@@ -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: functions/sybase-fetch-array.xml
===================================================================
RCS file: /repository/phpdoc/en/reference/sybase/functions/sybase-fetch-array.xml,v
retrieving revision 1.2
diff -u -r1.2 sybase-fetch-array.xml
--- functions/sybase-fetch-array.xml	17 Apr 2002 06:44:40 -0000	1.2
+++ functions/sybase-fetch-array.xml	23 Mar 2003 14:31:14 -0000
@@ -27,9 +27,50 @@
      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)
+}
+]]>
+	</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: functions/sybase-fetch-object.xml
===================================================================
RCS file: /repository/phpdoc/en/reference/sybase/functions/sybase-fetch-object.xml,v
retrieving revision 1.3
diff -u -r1.3 sybase-fetch-object.xml
--- functions/sybase-fetch-object.xml	19 Feb 2003 22:10:28 -0000	1.3
+++ functions/sybase-fetch-object.xml	23 Mar 2003 14:31:14 -0000
@@ -11,16 +11,69 @@
      <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>
     <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
Index: functions/sybase-fetch-row.xml
===================================================================
RCS file: /repository/phpdoc/en/reference/sybase/functions/sybase-fetch-row.xml,v
retrieving revision 1.3
diff -u -r1.3 sybase-fetch-row.xml
--- functions/sybase-fetch-row.xml	19 Feb 2003 22:10:28 -0000	1.3
+++ functions/sybase-fetch-row.xml	23 Mar 2003 14:31:14 -0000
@@ -26,8 +26,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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to