Field sizeof function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Patient Guy

    Field sizeof function


    I can find no PHP function that returns the maximum limit of field. For
    instance, when I see "varchar(25 6)" 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_fi eld'
    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.
  • Rik Wasmus

    #2
    Re: Field sizeof function

    On Mon, 27 Oct 2008 14:27:30 +0100, Patient Guy
    <sevisen.adam@g maildotherecomw rote:
    >
    I can find no PHP function that returns the maximum limit of field. For
    instance, when I see "varchar(25 6)" 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_fi eld'
    do not give me what I want.
    comp.databases. mysql?

    SHOW FULL COLUMNS FROM tablename;
    DESCRIBE tablename;
    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.
    You could learn a lot by looking through phpMyAdmin's code.
    --
    Rik

    Comment

    Working...