0

I am trying to remove some rows in my tables that are constrained by foreign keys. Is there a way to disable foreign key checks to allow the deletion of these items? Possibly through Medoo::raw() ?

Matt Butler
  • 476
  • 6
  • 21

1 Answers1

1

Foreign keys can be disabled by putting $database->query('SET FOREIGN_KEY_CHECKS = 0'); before your normal Medoo statement. Don't forget to run $database->query('SET FOREIGN_KEY_CHECKS = 1'); after you are finished with the need to disable.

Matt Butler
  • 476
  • 6
  • 21