- Moderated by:
- Support
-
- rank:
-
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 -
- rank:
-
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 -
- rank:
-
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 -
- rank:
-
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
--
-
- rank:
-
Freshman
- registered:
- August 2004
- Status:
- offline
- last visit:
- 15.06.08
- Posts:
- 24
-
- rank:
-
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
)
--
