Solved

Why is PHP function odbc_result() yielding an empty string for MS-Access memo fields?

Posted on 2008-06-20
2
1,105 Views
Last Modified: 2013-12-13
I'm writing PHP code to dynamically show values from a query to an MS-Access database. I'm using the odbc_ group of PHP functions to do this. In the attached snippet, the $name argument references a field-name in the Access database. Now, the actual Access field that's referenced may be a text field (max. 255 characters) or a memo field (max. 65KB). For some reason, when a memo field is referenced, its value shows up as an empty string when I use function odbc_result(). By contrast, Access text fields are fetched with no problem, using the same line of code in my snippet below. How do I get the memo field values returned from function odbc_result()?
// Part of PHP code that builds an HTML string to echo to the web browser.
// The field $name may reference a an Access text or memo field.
$row .= odbc_result($docResultId, $name);

Open in new window

0
Comment
Question by:bob2ee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
Rurne earned 125 total points
ID: 21834316
By default, odbc_result doesn't know how to convert MEMO to BLOB or CLOB.  You'll need to use odbc_longreadlen() to set how "big" the column is in order to read the memo field appropriately.
http://us2.php.net/manual/en/function.odbc-longreadlen.php
0
 

Author Closing Comment

by:bob2ee
ID: 31469265
I apologize, but it turned out that the odbc_result() behaviour was being affected by odbc_fetch_row(). I.e., the latter function was the cause of my problem. SO I suggest you delete the entire question from the Experts Exchange system. Again, my apologies to EE and expert Rurne.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question