Pergunta

I know that it can be done with varchar, char and others. but, is it possible with text?

Foi útil?

Solução

TEXT itself can't be limited, but you can limit - through the code that's handling then passing it to the PHP - how much the user can enter. For example, in javascript, if "str.length>X" you could alert "Stop being so long-winded," rather than posting to the PHP handling page - that is, of course, very easily defeated. However, couple that with a check in the php before putting it into the database, and you should be good.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top