Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
someone can tell me what my error on this?
CREATE TABLE `submit` (
`id` INT( 6 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
`name` CHAR( 75 ) NOT NULL ,
`url` CHAR( 75 ) NOT NULL ,
`description` TEXT( 150 ) NOT NULL ,
`vote` INT( 6 ) DEFAULT '0' NOT NULL ,
PRIMARY KEY ( `id` ) ,
UNIQUE (
`name` ,
`url`
)
)cause i got this error :
#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 '(150) NOT NULL, `vote` INT(6) DEFAULT '0' NOT NULL, PRIMARY KEY
thanks for help

Most of the single quotes that you have are illegal. You can't have quotes around 'submit' nor any of the field names (id, name, url, etc).
Actually, I'd guess that none of them are necessary.
You can download MySQL documentation at dev.mysql.com/doc. I keep a link to this documentation on my desktop so that I can get to it easily.
Be sure to come back and let us know if our suggestions helped!

yeah but im using phpmyadin so i dont have to write the code.
sorry i have not mention that on my first post

According to the MySQL docs (this page), the TEXT field is not allowed to have a length attribute (the 150 in parens).
Note that for int, the definition includes:
INT[(length)]
indicating that after INT you can include parens with a length integer.
But the TEXT field does not include this option.
Why phpmysqladmin would allow you to do this if it's illegal, I can't say. Maybe it's legal in some versions and not others.Be sure to come back and let us know if our suggestions helped!

those arent single quotes, those are the shift tilde thingy's which i dont remember the name of.
FBI Agent
AIM: EliteAssassin187

![]() |
Calling java script funct...
|
Need help for Upload Pic ...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |