TinyPortal
General => Chit chat => Topic started by: gfxindia on July 30, 2006, 04:31:19 PM
I am wanting to add a new field to a database table.
But i get this error.
Error
SQL query:
ALTER TABLE `simple_messages` ADD `extra` VARCHAR( 25 ) UNSIGNED NOT NULL AFTER `subject`
MySQL said: Documentation
#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 'UNSIGNED NOT NULL AFTER `subject`' at line 1
Please Could somebody help me .
ALTER TABLE `simple_messages` ADD `extra` VARCHAR( 20 ) NOT NULL AFTER `subject` ;
Is UNSIGNED not related to numbers (int, bigint, etc) which you dont have.
So what should i do ?
Dont know :)
Depends what it for? and what your trying to do? and how critical it is? why it has UNSIGNED in it for a start?
Whats going to be in the "extra" field? - up to 20 Characters (VARCHAR( 20 )) just now ? if thats ok then UNSIGNED doesnt apply
so use
ALTER TABLE `simple_messages` ADD `extra` VARCHAR( 20 ) NOT NULL AFTER `subject` ;
I'll try this
The extra is going to be some piece of text
this worked
Thanks