Fork me on GitHub

Problems with tables  Bottom

  • 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?
  • 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.

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • 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!!
  • For text fields, you can use,
    VARCHAR(255) (where the number is the max long of the string), or
    TEXT
  • mmm... but, How it is called to Text?

    Nice to meet you, gerkynet xDDDDDD
  • 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 )

This list is based on users active over the last 60 minutes.