Problems inserting a large string into a mediumtext field
Posted: Sat Apr 12, 2008 3:25 am
Hello together,
I'm having extreme difficulties inserting a large string of 1243746 characters into a mediumtext field produkte_volltext . MysQL Server Version: 5.0.51a-log. Table is a MyISAM, collation utf8_general_ci.
Here my code-snippet
After running the script, I always checked how many characters where actualy in the mediumtext field produkte_volltext with following SQL-statement:
SELECT CHAR_LENGTH( produkte_volltext ) AS zeichen FROM `firmendaten` WHERE `idfirmendaten` =438073
I couldn't find out the exact number of characters, by which MySQL actually fails to insert the string, leaving the mediumtext field produkte_volltext empty.
=> Is there some limit of characters, whicht causes the UPDATE statement to fail inserting a large string?
Thank you for your help!
I'm having extreme difficulties inserting a large string of 1243746 characters into a mediumtext field produkte_volltext . MysQL Server Version: 5.0.51a-log. Table is a MyISAM, collation utf8_general_ci.
Here my code-snippet
Code: Select all
[...]
#echo mb_strlen($pipe_separated); # = 1243746
$pipe_separated = implode("|", $arrProdukte); # $arrProdukte holds the products in an array
#$pipe_separated = substr($pipe_separated,0,1088277); #error, mediumtext field produkte_volltext is empty!
$pipe_separated = substr($pipe_separated,0,1000000); #ok, mediumtext field holds exactly, 1000000 characters
$strSQL = "UPDATE firmendaten SET produkte_volltext = '".mysql_escape_string($pipe_separated)."' WHERE idfirmendaten = ".$intFirmenId;
mysql_query($strSQL);
[...]
After running the script, I always checked how many characters where actualy in the mediumtext field produkte_volltext with following SQL-statement:
SELECT CHAR_LENGTH( produkte_volltext ) AS zeichen FROM `firmendaten` WHERE `idfirmendaten` =438073
I couldn't find out the exact number of characters, by which MySQL actually fails to insert the string, leaving the mediumtext field produkte_volltext empty.
=> Is there some limit of characters, whicht causes the UPDATE statement to fail inserting a large string?
Thank you for your help!