|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-01-03 12:45 UTC] r dot willett at linst dot ac dot uk
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 13:00:01 2025 UTC |
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); ?>