I want to limit the max size of a MySQL SELECT using PHP. I could some sort of iteration with PHP, but that would be less efficient. Is there a way I can set the maximum string size or byte size of something to return? Thanks.
What about
SELECT SUBSTR(myString, 1, 10) as myString from myTable
EDIT:
Then you want
SELECT myString from myTable where length(myString) < 11
You also have char_length
and bit_length
.