Solved

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

Posted on 2008-06-20
2
1,097 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
2 Comments
 
LVL 9

Accepted Solution

by:
Rurne earned 125 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
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.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now