Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Problems with tables
  • Posted: 15.09.2006, 14:43
     
    jpeeri
    rank:
    Freshman Freshman
    registered:
     August 2004
    Status:
    offline
    last visit:
    15.06.08
    Posts:
    24
    Hi All!!

    Sorry for my english, but I don't speak english very well.

    I'm creating a module, and I have this problem. A row of my table must be of type text, but not as it is denominated:

    Code

    // Themes
        $hpnThemesthemetable  = &$pntable['hpnthemes_theme'];
        $hpnThemesthemecolumn = &$pntable['hpnthemes_theme_column'];

        $dict = &NewDataDictionary($dbconn);

        $taboptarray =& pnDBGetTableOptions();

        $flds = "
            $hpnThemesthemecolumn[cid]        I(30)    NOTNULL,        
            $hpnThemesthemecolumn[tid]        I(30)    AUTOINCREMENT PRIMARY,
            $hpnThemesthemecolumn[type]       C(100)   NOTNULL DEFAULT '',
            $hpnThemesthemecolumn[author]     C(100)   NOTNULL DEFAULT '',
            $hpnThemesthemecolumn[langs]      C(200)   DEFAULT '',
            $hpnThemesthemecolumn[xhtml]      I(1)     DEFAULT '0',
            $hpnThemesthemecolumn[preview]    C(254)   NOTNULL DEFAULT 'images/themes/',
            $hpnThemesthemecolumn[desc]       T        DEFAULT ''
            "
    ;


    This code isn't valid. Where is the problem?

    --
    JaooZi
  • Posted: 15.09.2006, 15:35
     
    Simon
    rank:
    Steering Committee Steering Committee
    registered:
     December 2002
    Status:
    offline
    last visit:
    28.11.08
    Posts:
    13417
    The best thing is to echo the generated SQL and paste it into phpMyAdmin for verification.

    You shouldn't quote the 0 you have in your XHTML column, as on MySQL this may cause a problem, since you're inserting a string into an integer column.

    --
    Regards,
    Simon

    itbegins.co.uk - Zikula Consulting

    Please read the Support Guide
  • Posted: 15.09.2006, 16:41
     
    jpeeri
    rank:
    Freshman Freshman
    registered:
     August 2004
    Status:
    offline
    last visit:
    15.06.08
    Posts:
    24
    I believe that the problem is in the T of the row desc. I believe that he is not called thus to the type text...

    Thanks!!

    --
    JaooZi
  • Posted: 15.09.2006, 17:06
     
    gerkynet
    rank:
    Helper Helper
    registered:
     February 2006
    Status:
    offline
    last visit:
    21.11.06
    Posts:
    257
    For text fields, you can use,
    VARCHAR(255) (where the number is the max long of the string), or
    TEXT

    --
  • Posted: 15.09.2006, 17:11
     
    jpeeri
    rank:
    Freshman Freshman
    registered:
     August 2004
    Status:
    offline
    last visit:
    15.06.08
    Posts:
    24
    mmm... but, How it is called to Text?

    Nice to meet you, gerkynet xDDDDDD

    --
    JaooZi
  • Posted: 15.09.2006, 17:59
     
    gerkynet
    rank:
    Helper Helper
    registered:
     February 2006
    Status:
    offline
    last visit:
    21.11.06
    Posts:
    257
    Yes, & you have others types, subtypes & definions, that is possible use for text data, as BLOB (TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB) or (TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT)

    But better if you take a look to the mySql referenca manual.

    ( I can explain deeply, in spanish, & please don't be silly icon_rolleyes )

    --

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula