Bug #3941: ifx_create_blob truncates text to approx 1150 chars
| From: | jnoe at nomadsoft dot co dot uk | Date: | Tue, 28 Mar 2000 09:04:37 +0000 |
| Subject: | Bug #3941: ifx_create_blob truncates text to approx 1150 chars | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-17325@lists.php.net to get a copy of this message | ||
From: jnoe@nomadsoft.co.uk
Operating system: AIX 4.1
PHP version: 3.0.15
PHP Bug Type: Misbehaving function
Bug description: ifx_create_blob truncates text to approx 1150 chars
DESCRIPTION
===========
When adding data of type text to our DB, it gets truncated to approx 1150 chars. However, it is not
just the first textarea (from a web form) that gets truncated, it is the SUM of the text areas. I.E
we have three text areas, if the first is 1700 chars, only the first 1150 (approx) chars of that
will be added, and the last two won't be added at all. If the sum of all three is only 1000
chars, all will be added without a problem.
We are using Informix 7.1
SAMPLE CODE
===========
...
// Blobs - add to blobidarray for the ifx_query
case 3: $textid = ifx_create_blob(0,0,"$val");
// NB - even if you change this to
// ifx_create_blob(1,0,"$val"), it doesn't work
$blobidarray[] = $textid;
break;
...
...
// If we're not dealing with a blob, add the newly
// trimmed and formatted string to the insert statement
if ($typeid != 3)
{
$query = $query . $val . ", ";
}
// Otherwise add a '?' that will relate to the blobidarray
else
{
$query = $query . "?, ";
}
...
...
$query = chop($query);
// Trim last ,
$query = substr($query, 0, strlen($query) - 1) . ")";
// Run the query
$res = ifx_query($query, $db_conn, $blobidarray);
...
COMPILED OPTIONS
================
--with-informix
--with-xml
--with-apache=/export/oss/apache.new/blah blah
--with-gd=no
(that's all I can remember - sorry!)
PHP3.INI
========
N/A