User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 391,665 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,876 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 527 | Replies: 2
Reply
Join Date: Mar 2007
Posts: 2
Reputation: LucidNonsense is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
LucidNonsense LucidNonsense is offline Offline
Newbie Poster

Foreign Keys

  #1  
Feb 17th, 2008
Hi there I'm setting up twp table that are linked with a foreign key.

members

customer_id (primary)
fobnumber ZERO FILLED
firstname
lastname
emailaddress
access_id (foreign)

userAccess

access_id (primary)
username
password

(engine: InnoDB)
I have created recreated these tables, when both tables seem to linked. Data will go in to one database but not the other. i get the following error:

#1452 - Cannot add or update a child row: a foreign key constraint fails

please help

Craig.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Posts: 72
Reputation: gerard4143 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 9
gerard4143 gerard4143 is offline Offline
Junior Poster in Training

Re: Foreign Keys

  #2  
Feb 18th, 2008
Reply With Quote  
Join Date: Jul 2006
Location: Remunj
Posts: 165
Reputation: pritaeas is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 16
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Junior Poster

Re: Foreign Keys

  #3  
Feb 20th, 2008
It means that you are trying to update a foreign access_id, which is not yet in the userAccess table.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 1:47 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC