php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #349 odbc_result() fails for memo fields
Submitted: 1998-05-05 14:25 UTC Modified: 1998-05-06 07:00 UTC
From: leon at clearink dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 3.0 Release Candidate 4 OS: NT 4.0
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: leon at clearink dot com
New email:
PHP Version: OS:

 

 [1998-05-05 14:25 UTC] leon at clearink dot com
I'm using PHP to talk to an MS Access database.

odbc_result() returns the value of the field on
columns of most datatypes.  When naming a memo
field the contents of the field is echoed to the browser
and returns 1.  I've tested the same functionality with
Tango and do not get this result, therefore it is not
an problem with the ODBC driver.

There seems to be a similar bug where the reply was that
this is a feature, not a bug.  I disagree.

Script on my server: <http://atlas.clearink.com/weird_odbc.php3>
Script showing phpinfo(): <http://atlas.clearink.com/phpinfo.php3>

Here's the script:

<HTML>
<HEAD><TITLE>Demonstration of Weird ODBC Behavior</TITLE></HEAD>
<BODY>
<?
	/* connect to the data source */
	echo "Connecting to database<BR><BR>\n";
	$DatabaseID = odbc_pconnect("mao", "", "");

	/* execute query */
	echo "Executing Query<BR><BR>\n";
	$dbResult = odbc_exec($DatabaseID, "SELECT * FROM activitytype");

	/* get each row */
	while (odbc_fetch_row($dbResult)) 
	{
		echo "Fetched a row<BR><BR>\n";

		/* put three of the columns into variable */
		echo "Setting Variables<BR><BR>\n";
		$acttype_id = odbc_result($dbResult, "ID");
		$acttype_shortdescription = odbc_result($dbResult, "ShortDescription");
		$acttype_longdescription = odbc_result($dbResult, "LongDescription");

		/* print out the variables */
		echo "Printing data<BR><BR>\n";
		echo $acttype_id . " " . $acttype_shortdescription . "<BR>\n";
		echo $acttype_longdescription . "<BR><BR>\n";
	}

	/* free the memory */
	echo "Freeing result<BR><BR>\n";
	odbc_free_result($dbResult);

?>

</BODY>
</HTML>



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-06 07:00 UTC] kara
Please refer to the documentation for odbc_longreadlen() and odbc_binmode() on how to get
LONG column values returned to your script.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC