Topic: Problems with tables
jpeeri
avatar
Freshman
Freshman
Posts: 24

Posted:
15.Sep 2006 - 14:43

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
Simon
online
avatar
Steering Committee
Steering Committee
Posts: 13427

Posted:
15.Sep 2006 - 15:35

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
jpeeri
avatar
Freshman
Freshman
Posts: 24

Posted:
15.Sep 2006 - 16:41

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
gerkynet
avatar
Helper
Helper
Posts: 257

Posted:
15.Sep 2006 - 17:06

For text fields, you can use,
VARCHAR(255) (where the number is the max long of the string), or
TEXT

--
_00_

Hispa-PN.net - Desarrollos PostNuke
jpeeri
avatar
Freshman
Freshman
Posts: 24

Posted:
15.Sep 2006 - 17:11

mmm... but, How it is called to Text?

Nice to meet you, gerkynet xDDDDDD

--
JaooZi
gerkynet
avatar
Helper
Helper
Posts: 257

Posted:
15.Sep 2006 - 17:59

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 )

--
_00_

Hispa-PN.net - Desarrollos PostNuke