Gossamer Forum
Home : General : Perl Programming :

SQL Query..

Quote Reply
SQL Query..
Anyone got any idea why my SQL query isz not working? I have spent the last hour staring at it, but it still wont work Frown

It is;

Code:
CREATE TABLE `guestbook_table` (
`newID` SMALLINT(5) NOT NULL AUTO_INCREMENT,
`personname` TEXT(255) NOT NULL,
`comment` TEXT(255) NOT NULL,
`email` TEXT(255) NOT NULL,
`adddate` DATE(255) NOT NULL)

Thanks

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] SQL Query.. In reply to
Probably because newID has to be specified as a primary key.
Quote Reply
Re: [AndyNewby] SQL Query.. In reply to
You can not specify a colum length for a TEXT column therefore all of your TEXT(255) statements will produce an error.

Cheers

- wil
Quote Reply
Re: [AndyNewby] SQL Query.. In reply to
If you want to vary the maximum length of characters in "text" based columns, you should use either "VARCHAR" or "CHAR", then you can use (number) to specify a max length.

Also, you should always use INT for primary keys in tables, NOT SMALLINT, and as Paul mentioned, that field should be PRIMARY.
========================================
Buh Bye!

Cheers,
Me