| Topic: | Problems with tables |
|---|---|
|
jpeeri
Freshman
Posts: 24 Posted: |
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 Steering Committee
Posts: 13427 Posted: |
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
Freshman
Posts: 24 Posted: |
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
Helper
Posts: 257 Posted: |
For text fields, you can use, VARCHAR(255) (where the number is the max long of the string), or TEXT -- |
|
jpeeri
Freshman
Posts: 24 Posted: |
mmm... but, How it is called to Text? Nice to meet you, gerkynet xDDDDDD -- JaooZi |
|
gerkynet
Helper
Posts: 257 Posted: |
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 -- |