problem with TEXT field
Posted: Sat Apr 16, 2005 11:48 am
hi
I got a problem with setting up a table that includes a text field i phpMyAdmin. The main idea is that the text field is gonna contain text of variable length in my database. (I'm using it for news segments and stuff like that)
well here is my code:
and here is the MySql error:
Questions:
1. Why?
2. Is it the best way?
3. Is using BLOB better?
hope somebody can help me
regards
thallish
I got a problem with setting up a table that includes a text field i phpMyAdmin. The main idea is that the text field is gonna contain text of variable length in my database. (I'm using it for news segments and stuff like that)
well here is my code:
Code: Select all
CREATE TABLE `segment` (
`id` INT NOT NULL AUTO_INCREMENT ,
`headline` VARCHAR( 40 ) NOT NULL ,
`description` VARCHAR( 200 ) NOT NULL ,
`content` TEXT( 1000 ) NOT NULL ,
`author` VARCHAR( 10 ) NOT NULL ,
`viewed` INT NOT NULL ,
`type` VARCHAR( 10 ) NOT NULL ,
`area` VARCHAR( 10 ) NOT NULL ,
`date` DATETIME NOT NULL ,
PRIMARY KEY ( `id` ) ,
INDEX ( `headline` , `type` , `area` )
)Code: Select all
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(1000) NOT NULL, `author` VARCHAR(10) NOT NULL, `viewed` INT NO1. Why?
2. Is it the best way?
3. Is using BLOB better?
hope somebody can help me
regards
thallish