php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11763 odbc_exec() throws ISE 500 error
Submitted: 2001-06-27 22:45 UTC Modified: 2002-05-21 23:00 UTC
From: lustig at acsu dot buffalo dot edu Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.6 OS: Windows 98 SE
Private report: No CVE-ID: None
 [2001-06-27 22:45 UTC] lustig at acsu dot buffalo dot edu
I have a bug... I have a function (of which the following code is from) which pulls data from a remote MS SQL database through ODBC. The line with odbc_exec() is throwing an iSE 500 error on apache 1.3.14 (which I knwo to be the exact line because it's fine when it's commented out). I am using the PHP 4.06 windows binaries (from the PHP site) with the extra options installed... and to note, $global_conn is a global persistent connection that is being made global for the function of which the following code is a snippet:

	global $page, $action, $ID, $user_data;
	global $global_conn, $bgcolor;
	$SQL = 'SELECT bunnyID, name, email, content, signed, IP, dateAdded FROM plotbunnies';
	if ($action == 'view')
	{
		$SQL.= ' WHERE bunnyID = '.dbtext($ID);
	}
	$SQL.= ' ORDER BY dateAdded DESC ;';
	$bunnies= odbc_exec($global_conn, $SQL);

When the $bunnes = odbc_exec($global_conn, $SQL); line is commented, it is fine; otherwise it gives me an HTTP ISE 500 error.

--Jason

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-27 22:47 UTC] lustig at acsu dot buffalo dot edu
Another note on the above code snippet -- the dbtext() function just puts quotes around whatever is the params... ie, dbtext(1) would return "1" (the quotes being part of the returned string).

--Jason
 [2001-06-30 01:57 UTC] lustig at acsu dot buffalo dot edu
Another thing -- I've been playing around with some other code, and am getting the same type of thing. I think that the problem is witth fields of the type "text". When I take out the field "content" from the query in the first snippet, it works fine. Otherwise, 500 error. With another piece of code very similar to that one, it SELECTs a field "summary" from the table "fanfic". "summary" is a text field, and it throws the 500 error. So I'm pretty sure that it's SELECTing text datatype fields that is giving the 500 error.

--Jason
 [2002-05-21 23:00 UTC] kalowsky@php.net
type TEXT is not a valid ODBC type in version 2.0 and 3.0 systems.  It is in version 3.5 and greater... PHP does not support ODBC 3.5 or better yet.  I'm still working on that. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC