| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Subscribe and Support WebmasterWorld|
|MySql error adding new row|
| 1:57 pm on Aug 12, 2008 (gmt 0)|
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!
| 2:16 pm on Aug 12, 2008 (gmt 0)|
"SMALLINT" is an integer type, you probably need something like NUMERIC or DECIMAL (I forget which one MySQL uses, maybe both).
| 5:21 pm on Aug 12, 2008 (gmt 0)|
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.
© Webmaster World 1996-2013 all rights reserved