Solved

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

Posted on 2008-06-20
2
1,110 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
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.

738 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