Bug #52658 [NEW]: odbc_fetch_row doesn't fetch memo field
| From: | cyoung at gcs dot neric dot org | Date: | Fri, 20 Aug 2010 15:38:42 +0000 |
| Subject: | Bug #52658 [NEW]: odbc_fetch_row doesn't fetch memo field | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-153662@lists.php.net to get a copy of this message | ||
From:
Operating system: Windows Sever 2008
PHP version: 5.3.3
Package: ODBC related
Bug Type: Bug
Bug description:odbc_fetch_row doesn't fetch memo field
Description:
------------
odbc_fetch_row doesn't retrieve a memo field from MS access db. It does
however retrieve all the other fields in the same row successfully.
Without the use of odbc_fetch_row, odbc_result retrieves the memo field
exactly as expected. This obviously poses a problem only when trying to
retrieve more than one row in a database, which is usually the case more
than not.
Test script:
---------------
while(odbc_fetch_row($result)) {
$newsID = odbc_result($result, "newsID");
$newsTitle = odbc_result($result, "newsTitle");
$titleLink = odbc_result($result, "titleLink");
$brief = trim(odbc_result($result, "brief"));
$link = $titleLink.$newsID;
$newsBrief = substr($brief, 0, 75);
echo "<div id=\"newsLink\" class=\"newsTitle\"><a
href=\"$link\"
onclick=\"window.open('$link', 'GCSNews', 'width=500, height=400,
menubar=no, toolbar=no, resizable=no, top=100, left=200'); return
false;\">$newsTitle</a></div>";
echo "<div class=\"newsBrief\">$newsBrief...</div>";
}
Expected result:
----------------
I expected the memo field "brief" to be fetched, trimmed, and then a
substring of the first 75 characters to be stored in $newBrief and print
out followed by ...
Actual result:
--------------
...
when trouble shooting, just echoing $brief showed nothing in the browser.
$brief is an empty string when used in conjunction with odbc_fetch_row.
--
Edit bug report at http://bugs.php.net/bug.php?id=52658&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52658&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52658&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52658&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=52658&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52658&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=52658&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=52658&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=52658&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=52658&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=52658&r=support
Expected behavior: http://bugs.php.net/fix.php?id=52658&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=52658&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=52658&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=52658&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52658&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52658&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=52658&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=52658&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=52658&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=52658&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=52658&r=mysqlcfg