title: MySQL Foreign Key: Cannot add or update a child row: a foreign key constraint fails
body: <p>I've created several tables, one being the parent table and three children tables.     </p>
  
  <pre><code>CREATE TABLE `members` (
   `memberID` int(11) NOT NULL AUTO_INCREMENT,
   `username` varchar(255) NOT NULL,
   `password` varchar(60) NOT NULL,
   PRIMARY KEY (`memberID`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
  
  CREATE TABLE `pets` (
   `petsID` int(11) NOT NULL AUTO_INCREMENT,
   `Gender` varchar(25) NOT NULL,
   `Age` varchar(25) NOT NULL,
   `Size` varchar(25) NOT NULL,
   `memberID` int(11) NOT NULL,
   PRIMARY KEY (`petsID`),
   KEY `fk_pets` (`memberID`),
   CONSTRAINT `pets_ibfk_1` FOREIGN KEY (`memberID`) REFERENCES `members` (`memberID`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
  
  CREATE TABLE `owner` (
   `ownerID` int(11) NOT NULL AUTO_INCREMENT,
   `nameOwner` varchar(25) NOT NULL,
   `ageOwner` varchar(25) NOT NULL,
   `bioOwner` varchar(800) NOT NULL,
   `memberID` int(11) NOT NULL,
   PRIMARY KEY (`ownerID`),
   KEY `fk_owner` (`memberID`),
   CONSTRAINT `owner_ibfk_1` FOREIGN KEY (`memberID`) REFERENCES `members` (`memberID`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
  
  CREATE TABLE `service` (
   `serviceID` int(11) NOT NULL AUTO_INCREMENT,
   `nameService` varchar(25) NOT NULL,
   `webService` varchar(25) NOT NULL,
   `memberID` int(11) NOT NULL,
   PRIMARY KEY (`serviceID`),
   KEY `fk_service` (`memberID`),
   CONSTRAINT `service_ibfk_1` FOREIGN KEY (`memberID`) REFERENCES `members` (`memberID`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1
  </code></pre>
  
  <p>After testing out my table I've gotten this error: </p>
  
  <pre><code>INSERT INTO owner (nameOwner, ageOwner, bioOwner) VALUES ('', '', '')
  Cannot add or update a child row: a foreign key constraint fails (`DB`.`owner`, CONSTRAINT `owner_ibfk_1` FOREIGN KEY (`memberID`) REFERENCES `members` (`memberID`) ON DELETE CASCADE ON UPDATE CASCADE)
  </code></pre>
  
  <p>I've already tried truncating my parent table but it still comes up with this error. I'm a beginner at database design so please explain like I'm 5.</p>