Msaccess - sql - odbc - php

I have a problem GETTING data from my MSACCESS/ODBC connection. Basically I want to query my database and display the data in a text box or just as text. The problem is, it will not retrieve all of the data in the database field. Here’s the snippet of code I am working with. Thanks, in advance, for the help.

$conn is defined in an include.php file

<? 
$sql="SELECT * FROM tblCustomer WHERE CParentRefID = '$web_parentrefid' AND CJobInvoice = '$postciunum' "; 
$rs=odbc_exec($conn,$sql); 

$cjobinstructions=odbc_result($rs,"CJobInstructions" ); // This is the section that does not populate properly.

?> 
<textarea style="width: 100%; height:100%; rows=100%; color: black; background-color: white" name="updatedjobinst" wrap="physical" ><?=$cjobinstructions?></textarea><br /> 

What is returned in $cjobinstructions: 586 words, 4,015 characters

What’s in the database field CJobInstructions: 9000 words, 60,734 characters

I don’t know if this is relevant, but I have the following setup: Dual Intel Xeon 3.06, 4 GB Ram, WIN XP Pro SP3, WAMP 2.0, Apache 5.3.0, PHP 5.3.0, MS Access 2003

I found the problem. It was in the PHP.ini file. I found the following line:

odbc.defaultlrl = 4096

and changed it to

odbc.defaultlrl = 409600

Great, thanks for letting us know! :slight_smile:

For others though, the manual page for this configuration states:

odbc.defaultlrl integer
Handling of LONG fields. Specifies the number of bytes returned to variables.

When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used.