Update Tables with FK Constraints

Hi All,

I’m having trouble figuring out how to update a users table that has this value added to it

 ADD CONSTRAINT `users_1` FOREIGN KEY (`userid`) REFERENCES `home` (`userid`) ON DELETE CASCADE ON UPDATE CASCADE;

I tried writing this command in phpmyadmin but get an error:

INSERT INTO userprofile
SET userid = ‘3’,
fname = ‘abc’,
lname = ‘abcd’;

and get this error:

#1452 - Cannot add or update a child row: a foreign key constraint fails (mydb.userprofile, CONSTRAINT users_1 FOREIGN KEY (userid) REFERENCES home (userid) ON DELETE CASCADE ON UPDATE CASCADE)

First off, how do I insert anything into my tables (not created by me) and how would I update it?

Does userid 3 exist in the home table?

yes it does, so what do I do?