Phpmyadmin 2.6.0 doesn't want to let me set a character column length/longtext (240) on mysql.

Why is this?

This is a column where descriptions are being form inserted. On the form, javascript code limits the textarea to 235 characters with a regexp of 235. Only wanted to go one step further since this is the column that absolutely must be contained to 235/240.

Speculating on what would get beyond javascript limit -- if user has javascript turned off (button character count will take netscape back before 4.0 I beleive) -- and what would get beyond the regexp -- some esoteric browser?)

Is it normal that mysql longtext column length cannot be set via phpmyadmin?

    Well its not a PHPMyAdmin thing, its MySQL you cannot set a length allowed for LONGTEXT same goes with TEXT, If your under 255chars you should use varchar

      thanks planetsim

      maybe I'm wrong, I thought longtext used less memory which is why I thought of it.

      question -- what will happend to existing table values if I start with 230 varchar and change to 260 long text? will characters be altered?

        It will retain your data when change your field type.
        NOTE: if changing from TEXT to VARCHAR, your data will get cut to 255 because of the field character limit of 255 if you have more then 255 characters in your TEXT field.

          • thanks Frederick

          By TEXT I assume you mean longtext included.

            Characters allowed by type:

            VARCHAR = 255
            TINYTEXT = 255
            TEXT = 65,535
            MEDIUMTEXT = 16,777,215
            LONGTEXT = 4,294,967,295

              Write a Reply...