Field sizeof function

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I can find no PHP function that returns the maximum limit of field.  For
instance, when I see "varchar(256)" for the specification of a field, it's
the number "256" I am interested in.  Or perhaps what I am really
interested in is both the type and the number of bytes a field is allocated
(maximum permitted, not actually maximum used in a table with fields)

So anyone know what MySQL query function I would use to get info on a
field?  The object properties returned by PHP function 'mysql_fetch_field'
do not give me what I want.

As to why I want it, I want to set up a dynamic add/edit-data form in an
HTML page with text and textarea controls, the size/maxlength/rows/columns
of which are based on the number of characters allowed to set a value for a
field based on its type and byte size.

Re: Field sizeof function

On Mon, 27 Oct 2008 14:27:30 +0100, Patient Guy  

Quoted text here. Click to load it


DESCRIBE tablename;

Quoted text here. Click to load it

You could learn a lot by looking through phpMyAdmin's code.

Site Timeline