PHP 4.0 Bug #6065: Returns a "The document contained no data" error while accessing MS-SQL 7.0
| From: | jms18 at guinness dot som dot cwru dot edu | Date: | Thu, 10 Aug 2000 09:16:47 +0000 |
| Subject: | PHP 4.0 Bug #6065: Returns a "The document contained no data" error while accessing MS-SQL 7.0 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-28317@lists.php.net to get a copy of this message | ||
From: jms18@guinness.som.cwru.edu
Operating system: Red Hat 6.1
PHP version: 4.0.1pl2
PHP Bug Type: MSSQL related
Bug description: Returns a "The document contained no data" error while accessing MS-SQL
7.0
Here is the source:
<?
PrintHeader();
DisplayQueue();
PrintClose();
function PrintHeader()
{
print("<HTML>\n<HEAD>\n<TITLE>\nPHP Helpdesk v0.0.1
Alpha\n</TITLE></HEAD>\n<BODY>\n");
}
function PrintClose()
{
print("\n</BODY>\n</HTML>");
}
function ConnectDB($Server,$Database,$DBUser,$DBPsswrd)
{
$mssql_link = mssql_connect($Server,$DBUser,$DBPsswrd) or DIE("SERVER FAILED TO
RESPOND.");
mssql_select_db($Database) or DIE("Database unavailable");
return $mssql_link;
}
function RunQuery($Query, $Fetch, $Link)
{
if ($Fetch == 1)
{
return mssql_fetch_row(mssql_query($Query,$Link));
}
else
{
return mssql_query($Query,$Link);
}
}
function OpenTable($Alignment,$ColNumber,$CellSpace,$Border,$CellPadding,$Width)
{
print("<TABLE ALIGN=$Alignment COLS=$ColNumber CELLSPACING=$CellSpace BORDER=$Border
CELLPADDING = $CellPadding WIDTH=$Width>\n");
}
function DisplayQueue()
{
$MSsqlLink =
ConnectDB("Server","Datbase","user","password");
$Result = RunQuery("select * from tbl_WO_Entry, tbl_WO_Description, tbl_WO_Classification
where ((tbl_WO_Entry.WO_nos = tbl_WO_Description.WO_nos and tbl_WO_Entry.WO_nos =
tbl_WO_Classification.WO_nos) and (not (tbl_WO_Entry.status = 3 and tbl_WO_Entry.status = 4 and
tbl_WO_Entry.status = 5))) order by tbl_WO_Entry.Priority,tbl_WO_Entry.WO_nos",0,$MSsqlLink);
OpenTable("CENTER",5,0,1,0,"100%");
print("<TR>\n<TH WIDTH=\"5%\">WO#</TH>\n<TH
WIDTH=\"10%\">User</TH>\n<TH
WIDTH=\"5%\">Priority</TH>\n");
print("<TH WIDTH=\"60%\" ABBR>Description</TH>\n<TH
WIDTH=\"10%\">Status</TH>\n</TR>\n");
$Number = mssql_num_rows($Result);
print("$Number<BR>");
while($WORS = mssql_fetch_row($Result))
{
PrintQueueRow($WORS[0],$WORS[1],$WORS[3],$WORS[5],$WORS[2]);
}
print("</TABLE>\n");
mssql_close();
}
function PrintQueueRow($WONos,$UserName,$Priority,$Description,$Status)
{
print("<TR>\n<TD>$WONos</TD>\n<TD>$UserName</TD>\n<TD>$Priority</TD>\n");
print("<TD>$Description</TD>\n<TD>$Status</TD>\n</TR>\n");
}
?>
Here is the backtrace:
cd htdocs[root@som00258 apache]# gdb /usr/local/apache/bin/httpd
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x80e4843 in zend_hash_index_find ()
(gdb)