chunk_spilt error help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mccommunity
Forum Commoner
Posts: 62
Joined: Mon Oct 07, 2002 8:55 am

chunk_spilt error help

Post by mccommunity »

I am doing an insert from a csv file. One of the fields I had to parse spaces into. I am using the code below:
####################################
$query="INSERT INTO options VALUES ($event";
$num_fields = count($data);
for ($x=0;$x < $num_fields;$x++)
{

IF ($data[11]) { $data[11]= chunk_split($data[11], 3, ' '); }
$return_value = convert_string($data[$x]);
$query .= ", '$return_value'";


}
$query .= ")";

echo "</table></table></table>";
$r = pg_exec($c,$query);
##############################################

I have to use chunk_split on the 10th field to get the number to be seperated by a space at every 3rd character, it works until I add the chunk_split. Once I add the chunk split I get the following errrors below. Does anyone have any ideas?

ERROR: Tuple is too big: size 12804, max size 8140 ERROR: Tuple is too big: size 10112, max size 8140 ERROR: Tuple is too big: size 10112, max size 8140 ERROR: Tuple is too big: size 12804, max size 8140 ERROR: Tuple is too big: size 10112, max size 8140
mccommunity
Forum Commoner
Posts: 62
Joined: Mon Oct 07, 2002 8:55 am

one more note

Post by mccommunity »

I realize this is probably some sort of size issue but the numbers I am parsing are 30 characters max and are going into a unlimited text field. Is there a way to parse $var=8u7y6ty6t5tr54re3r4r5; into $var=8u7 y6t y6t 5tr 54r e3r 4r5; without using chunk split? Or is there a way to bump the chunk splits size capablities up? Thanks in advance.


Mark
Post Reply