<docbook><section><title>PHPReturningWrongValuesForLongFields</title><para> </para><bridgehead class="http://www.w3.org/1999/xhtml:h2">PHP Development Resources</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">PHP returning wrong values for long fields</bridgehead>
<para>PHP has a default setting on the php.ini file to control the maximum size of returned fields.
 The default is:</para><programlisting>odbc.defaultlrl = 4096
</programlisting><para> Any varchar (for example) longer than that value will return the first 4096 characters and, in some cases, random values to the field size.</para><para>The fix is set this value longer than the expected maximum length.</para><para>The PHP functions odbc_binmode (for binary data) and odbc_longreadlen can used to set this on a per statement basis.
</para></section></docbook>