PHP 4.0 Bug #3089: Additional EOS character returned when accessing dates

From: Date: Mon, 03 Jan 2000 16:58:54 +0000
Subject: PHP 4.0 Bug #3089: Additional EOS character returned when accessing dates
Groups: php.dev 
Request: Send a blank email to php-dev+get-14225@lists.php.net to get a copy of this message
From: r.willett@linst.ac.uk Operating system: Linux RH 6.0 PHP version: 4.0 Beta 3 PHP Bug Type: Sybase (dblib) related Bug description: Additional EOS character returned when accessing dates I have created a Sybase table with one of the fields defined as a date time. I have written a general purpose PHP script to pull information out of any table. This produces a simple HTML table to display information. The string returned in the array for the date and time sometimes has an extra character on the end of it. Not all the strings have it, just most of them. Refreshing the HTML display, thereby causing a new Sybase query, produces the same 'real' data but the additional character usually moves around. It looks awfully like the end of string character is too high by one. This is running at home and so I can easily change things around to help any debugging. Apache Version: Server version: Apache/1.3.6 (Unix) Server built: Sep 18 1999 11:42:30 mod_php is compiled in. Sybase Verion: SQL Server/11.0.3.3/P/Linux Intel/Linux 2.0.36 i586/1/OPT/Thu Sep 10 13:42:44 CEST 1998 PHP4 B3 Code: lib.php <? function print_table ($result) { $no_rows = sybase_num_rows($result); $no_fields = sybase_num_fields($result); print "<TABLE BORDER=1>\n"; for ($j = 0 ; $j < $no_rows ; $j++) { print "<TR>\n"; $array1 = sybase_fetch_row($result); for ($i = 0 ; $i < $no_fields ; $i++) { print "<TD>"; if ($array1[$i] == "") print "-"; else print $array1[$i]; print "</TD>"; } print "</TR>\n"; } print "</TABLE>\n"; } ?> and index.php <? require 'lib.php'; $db = sybase_connect("SYBASE" , "sa" , ""); $result = sybase_select_db("web" , $db); $result = sybase_query("select * from http_log where ip_address='195.195.78.106'" , $db); print_table($result); sybase_close($db); ?>

« previous php.dev (#14225) next »