Gossamer Forum
Home : General : Databases and SQL :

SQL Statement problems...

Quote Reply
SQL Statement problems...
Mmm... got a bit of a funny problem here. The following SQL;

Code:
CREATE TABLE phpCalendar_Permissions(

AdminUserID bigint( 20 ) unsigned NOT NULL ,
LocationID int( 10 ) unsigned NOT NULL ,
Permissions smallint( 5 ) unsigned DEFAULT '0' NOT NULL ,
PRIMARY KEY ( AdminUserID, LocationID ) ,
FOREIGN KEY ( LocationID ) REFERENCES phpCalendar_Locations( LocationID ) ON DELETE SET NULL ON UPDATE CASCADE ,
FOREIGN KEY ( AdminUserID ) REFERENCES phpCalendar_AdminUsers( AdminUserID ) ON DELETE SET NULL ON UPDATE CASCADE
)

.. gives me this error when running;

Quote:
Can't create table './jose_forum/phpCalendar_Permissions.frm' (errno: 150)

Aparantly this is down to a "foreign key constraint not being correctly formed".

Anyone got any ideas why I may be getting this?

TIA

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!
Subject Author Views Date
Thread SQL Statement problems... Andy 4072 Nov 17, 2003, 6:48 AM
Post Re: [Andy] SQL Statement problems...
Stealth 3827 Nov 17, 2003, 1:14 PM