Mmm... got a bit of a funny problem here. The following SQL;
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;
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!
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!