php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3089 Additional EOS character returned when accessing dates
Submitted: 2000-01-03 11:58 UTC Modified: 2000-01-03 12:46 UTC
From: r dot willett at linst dot ac dot uk Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 4.0 Beta 3 OS: Linux RH 6.0
Private report: No CVE-ID: None
 [2000-01-03 11:58 UTC] r dot willett at linst dot ac dot uk
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);
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-01-03 12:45 UTC] r dot willett at linst dot ac dot uk
This is not a bug. The error was produced by the wrong
Apache/PHP combination being tested against. Further work
with the RIGHT Apache/PHP B3 works fine.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 12:01:27 2024 UTC