Nadroev Nadroev - 11 months ago 109
SQL Question

How to check the current query packet size for MySql?

According to the answer to this question: What is maximum query size for mysql?

The max value is shown in bytes and not characters, so I can't decide when the time to split the query is. Would be even better if I could check that while the query is still a string in php since its length will be flexible.


You can simply use strlen() to measure the byte size of your query in php.

See manual at

Note: strlen() returns the number of bytes rather than the number of characters in a string.