Re: PHP 4.0 Bug #5444: Long VARCHARs create invalid strings

From: Date: Thu, 06 Jul 2000 19:46:38 +0000
Subject: Re: PHP 4.0 Bug #5444: Long VARCHARs create invalid strings
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-23744@lists.php.net to get a copy of this message
On Fri, Jul 07, 2000 at 07:23:40PM -0000, schmidt@bcc.de wrote: > From: schmidt@bcc.de > Operating system: linux 2.2 / glibc 2.1.3 > PHP version: 4.0.1pl2 > PHP Bug Type: Oracle related > Bug description: Long VARCHARs create invalid strings > > Any select command on VARCHARS (256+) does not return a "regular" string, but > (following a tcpdump) contains 0<CHAR>0<CHAR>0<CHAR>... > This causes a non-display with Netscape (not even visible in page source) 4.7x on Linux & > Win (at least). Lynx and MSIE (at least) do work. > I consider this a bug, as with PHP 3 the output was valid (and visible with Netscape). what version of PHP 3 are you referring to? tc > > I'm using Oracle 8.0.5.0.0 Linux - my PHP configuration command was > --without-pgsql --without-mysql --with-oci8 --with-zlib --sysconfdir=/etc --without-gd > --with-apxs > The webserver is not the same as the db machine, if this matters. > > The table is like > create table tab (col1 varchar(256), col2 varchar(256), col3 varchar(256)) > and the code used to print looks like > > function _db_nextresult($result) { > if (OCIFetchInto($result, $fetcharray, OCI_ASSOC)) { > return $fetcharray; > } else { > return false; > } > } > > for ($result_b = _db_nextresult ($result), $i=0; $result_b; $i++) { > while (list ($key, $val) = each ($result_b) ) { > echo "$key - $val<BR>"; > } > $result_b = _db_nextresult ($result); > } > > Note that with > printf ("%s - %s<BR>\n", $key, $val); > you wan't see a single thing, not even with lynx or MSIE, as IMHO the zero in the string > terminates it before the first character is printed. It also becomes quite difficult to parse the > string and replace the zeroes.... > > If you want to take a look at it, feel free to visit > http://something.bcc.de/test.php for a php test and > http://something.bcc.de/t2.php for the problem... > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

« previous php.dev (#23744) next »