Error when registering in Mysql

Asked

Viewed 54 times

0

I’m trying to make a record by form system, however I am receiving the following message :

Error:

  Cannot add or update a child row: a foreign key constraint fails
  (`gpiweb_pdi`.`avaliacoes_simulados`, CONSTRAINT
  `fk_usuario_cadastro_avaliacoes_simulados` FOREIGN KEY
  (`usuario_cadastro`) REFERENCES `usuarios_acesso` (`id_usuario`) ON
 DELETE NO ACTION ON U)

Someone would know what can be and how to solve?

Thank you

  • how are you doing this transaction ? is Insert? update? delete?

  • 1

    what I saw is missing you set the id_user to work.

  • Perfect José Vieira...is exactly this... could not go empty this field... Thank you

  • The error has to do with the foreign key FK... Check in the table construction if it is null... I hope to have helped....

1 answer

2


Check if you are setando the user id at the time of his transaction. he’s complaining that the fk user can not be null.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.