I am getting the following error:
PHP Question2Answer MySQL query error 1452: Cannot add or update a child row: a foreign key constraint fails
(`islamiqa`.`qa_uservotes`, CONSTRAINT `qa_uservotes_ibfk_2` FOREIGN KEY (`userid`) REFERENCES `qa_users` (`userid`) ON DELETE CASCADE) -
Query: INSERT INTO qa_uservotes (postid, userid, vote, flag, votecreated) VALUES (1340, 0, 1, 0, NOW()) ON DUPLICATE KEY UPDATE vote=1, voteupdated=NOW()
after running the following code:
qa_db_uservote_set($parentid, 5, 1);
qa_db_hotness_update($parentid, null, true);
Any thoughts what the problem is?