Foreign keys don't stick

Status
Not open for further replies.

sevorak

New Member
Messages
3
Reaction score
0
Points
0
When using the mySQL database, I can't seem to get my foreign keys to stay when I define them through phpMyAdmin. As an example, I use the following table definition:

Code:
CREATE TABLE `user_source` (
  `user_name` varchar(15) NOT NULL,
  `url` varchar(50) NOT NULL,
  PRIMARY KEY  (`user_name`,`url`),
  CONSTRAINT user_source_user_name_fk FOREIGN KEY (user_name) REFERENCES user(user_name),
  CONSTRAINT user_source_url_fk FOREIGN KEY (url) REFERENCES source(url)
)
But I can still insert rows that break the foreign keys and when exporting to an sql file, the foreign keys are not in the definition. What's going on here?
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
We don't restrict any MySQL functions or modify how users have access to it. Your best bet would be to do some research on Google.

-Corey
 
Status
Not open for further replies.
Top