| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|MySql error adding new row|
Not used mySql for a long time and having a problem adding to a simple table.
Trying to add the row 'Postage' - it should be able to hold values with decimals - 1.99 for example.
ALTER TABLE `main` ADD `postage` SMALLINT( 1.99 ) NULL
#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 '1.99) NULL' at line 1
Any help would be great, thanks!
"SMALLINT" is an integer type, you probably need something like NUMERIC or DECIMAL (I forget which one MySQL uses, maybe both).
It supports both NUMERIC and DECIMAL (one is implemented as other). You can check out the online docs at [dev.mysql.com...] or search for "mysql numeric data types" and look for the dev mysql site.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved