Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Cannot add foreign key
Old 02-06-2006, 07:29 AM Cannot add foreign key
Super Talker

Posts: 145
Trades: 0
Hi ,

I am trying to add a foreign key in a table, i have written the command to add the key but it doesn't do it.It doens't even display an error.Could you please help me i can't understand what is the problem. This is the command i wrote:

PHP Code:
Alter table Webusers ADD FOREIGN KEY(visitorid)REFERENCES sitevisitors(visitorid); 
The table that i am trying to add the foreign key is called "Webusers" with primary key the "userid". The foreign key is the "visitorid" from the table "sitevisitors".

Thank you in advance,
Xenia
xenia is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-06-2006, 01:36 PM Re: Cannot add foreign key
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
what database are you using? It may not support foreign key
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-21-2006, 07:32 AM Re: Cannot add foreign key
Super Talker

Posts: 145
Trades: 0
Sorry for the delay.I am using MySQL
xenia is offline
Reply With Quote
View Public Profile
 
Old 02-21-2006, 03:54 PM Re: Cannot add foreign key
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
FOREIGN KEY is only valid for InnoDB tables in MySQL I believe
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Cannot add foreign key
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 3.31595 seconds with 12 queries