182x wrote:Thanks I am currently using it to limit the amount of characters that a user can enter to a text area on a form.
Is this a bad idea as if its turned off and the amount of characters exceeds the limit defined in the database, could this cause problems?
It's a good idea, in that it gives immediate feedback to the users if they exceed the allowed limit while avoiding unnecessary net traffic. But, since you cannot 100% depend on that processing having happened when the data reaches your PHP script, you need to also validate it there (and if invalid either return the user to the form with an error message, or just truncate it to the maximum allowed characters depending on which makes more sense for the specific situation).
I am also using varchar to store this data is this ok or would text be better?
Use whichever makes sense for your application. Neither is "better" than the other, they just have different limitations, memory requirements, etc.