Gossamer Forum
Home : General : Databases and SQL :

Whats wrong with this syntax?

Quote Reply
Whats wrong with this syntax?
Can anyone see anything that is out of place or wrong in the code?

CREATE TABLE PayPal_Affiliates (
UniqueID int(11) NOT NULL auto_increment,
Password text NOT NULL,
Name text NOT NULL,
PayPal_Account text NOT NULL,
WebSite text NOT NULL,
WebSite_Title text NOT NULL,
isValidated text NOT NULL,
Jan int(11) NOT NULL default '0',
Feb int(11) NOT NULL default '0',
Mar int(11) NOT NULL default '0',
Apr int(11) NOT NULL default '0',
May int(11) NOT NULL default '0',
June int(11) NOT NULL default '0',
July int(11) NOT NULL default '0',
Aug int(11) NOT NULL default '0',
Sept int(11) NOT NULL default '0',
Oct int(11) NOT NULL default '0',
Nov int(11) NOT NULL default '0',
Dec int(11) NOT NULL default '0',
Total_Owed int(11) NOT NULL default '0',
UNIQUE KEY UniqueID (UniqueID)
) TYPE=MyISAM;


I'm getting;

MySQL said: You have an error in your SQL syntax near 'Dec int(11) NOT NULL default '0', Total_Owed int(11) NOT NULL default '0', UNI' at line 1.

Query: CREATE TABLE PayPal_Affiliates ( UniqueID int(11) NOT NULL auto_increment, Password text NOT NULL, Name text NOT NULL, PayPal_Account text NOT NULL, WebSite text NOT NULL, WebSite_Title text NOT NULL, isValidated text NOT NULL, Jan int(11) NOT NULL default '0', Feb int(11) NOT NULL default '0', Mar int(11) NOT NULL default '0', Apr int(11) NOT NULL default '0', May int(11) NOT NULL default '0', June int(11) NOT NULL default '0', July int(11) NOT NULL default '0', Aug int(11) NOT NULL default '0', Sept int(11) NOT NULL default '0', Oct int(11) NOT NULL default '0', Nov int(11) NOT NULL default '0', Dec int(11) NOT NULL default '0', Total_Owed int(11) NOT NULL default '0', UNIQUE KEY UniqueID (UniqueID) ) TYPE=MyISAM


Anyone got any ideas?

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: [Andy] Whats wrong with this syntax? In reply to
Dec is probably a reserved MySQL word? Try changing Dec to something different and see if that works.

- wil
Quote Reply
Re: [Wil] Whats wrong with this syntax? In reply to
Thanks..that worked great :) I'm surprised phpMyAdmin let me add 'Dec' on my local PC Crazy

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: [Andy] Whats wrong with this syntax? In reply to
You could try using [Dec]...brackets at least in SQL Server can be used around reserved names and allow you to use them as column names.
========================================
Buh Bye!

Cheers,
Me