2

I am trying to UPDATE a mysql TEXT data-type column with a string contains near 6,000 characters inside (6 kb data-size). Then the column is not updated with that data.

Then when i test this column by updating with test data around 100 characters, it works.

So, is there any limit on mysql query processing?
If so, how can i adjust it?

I'm using XAMPP on MacOSX.

6
  • 1
    AFAIK, If the limit was reached your data would be truncated - not ignored completely. Take PHP out of the equation and copy/paste the rendered query into mysql. Commented Jun 18, 2012 at 14:34
  • 1
    Have you ensured there are no special characters breaking your query? Commented Jun 18, 2012 at 14:35
  • text data type can have up to 65,535 characters. There is probably another problem with your data. Any special characters you are inserting? Commented Jun 18, 2012 at 14:35
  • Are you doing any error checking after your query? Can you show your code? Commented Jun 18, 2012 at 14:36
  • 1
    Oh, @Josh and other guys, thankssss about reminding special character. I was not checked it and now its ok by using mysql_escape_string. Thanks again :) Commented Jun 18, 2012 at 14:40

1 Answer 1

4

Try escaping your data properly. Your data would be truncated rather than denied (by default) by MySQL if it wouldn't fit. The max size for TEXT field is 64kb.

If your data contains characters like ' and " your query could fail. Add proper error handling to determine where and why things go wrong and escape your data accordingly.

Sign up to request clarification or add additional context in comments.

4 Comments

Oh yes it is escaping problem. Now its ok with mysql_escape_string .. thanks :)
In that case, mark this question answered please. Also, mysql_* is getting deprecated: cz.php.net/mysql_connect
Yes, MySQLI and PDO are replacing mysql_*. The deprecation process has begun, but it's not yet deprecated.
Actually, as of PHP 4.3.0, mysql_real_escape_string() should be used with MySQL extension instead of mysql_escape_string()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.