Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-20
2
Medium Priority
?
1,131 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 375 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

722 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