In my code, I use the variable $content
.
It's a text string with a length of ~200000.
$session
doesn't matter in this case.
If i try to insert the following data, ...
$c = mysql_real_escape_string($content);
mysql_query("
INSERT INTO data (time, session, key_, value_)
VALUES('".time()."', '".$session."', 'content', '".$c."')
");
...a new row is generated in the DB and time
, session
, key_
and value_
are written.
But when $content
had a length of ~200000, the inserted text is only a fragment of the first ~1300 characters.
The field type is set to longtext
, collation is utf8_bin
.
If i choose $c = strlen(mysql_real_escape_string($content));
, something about '200000' is written to value_
.
There is no mysql_error in any case.
So why is only a "short" fragment of my variable inserted?
edit:
To avoid this problem, I used base64_encode()
, to encode all data and the query did its job.