Fatal error: Uncaught mysqli_sql_exception: Cannot delete or update a parent row: a foreign key constraint fails (genesis
.producto
, CONSTRAINT producto_ibfk_2
FOREIGN KEY (codigoMedida
) REFERENCES unidades_medida
(codigo
)) in C:\xampp\htdocs\apicola\models\ActiveRecord.php:261 Stack trace: #0 C:\xampp\htdocs\apicola\models\ActiveRecord.php(261): mysqli->query('DELETE FROM uni...') #1 C:\xampp\htdocs\apicola\controllers\MedidaController.php(61): Model\ActiveRecord->eliminarLlaveExcepciones('codigo', '1') #2 [internal function]: Controllers\MedidaController::eliminarMedida(Object(MVC\Router)) #3 C:\xampp\htdocs\apicola\Router.php(51): call_user_func(Array, Object(MVC\Router)) #4 C:\xampp\htdocs\apicola\public\index.php(67): MVC\Router->comprobarRutas() #5 {main} thrown in C:\xampp\htdocs\apicola\models\ActiveRecord.php on line 261
Fatal error: Uncaught mysqli_sql_exception: Cannot delete or update a parent row: a foreign key constraint fails (`genesis`.`producto`, CONSTRAINT `producto_ibfk_2` FOREIGN KEY (`codigoMedida`) REFERENCES `unidades_medida` (`codigo`)) in C:\xampp\htdocs\apicola\models\ActiveRecord.php:261 Stack trace: #0 C:\xampp\htdocs\apicola\models\ActiveRecord.php(261): mysqli->query('DELETE FROM uni...') #1 C:\xampp\htdocs\apicola\controllers\MedidaController.php(61): Model\ActiveRecord->eliminarLlaveExcepciones('codigo', '1') #2 [internal function]: Controllers\MedidaController::eliminarMedida(Object(MVC\Router)) #3 C:\xampp\htdocs\apicola\Router.php(51): call_user_func(Array, Object(MVC\Router)) #4 C:\xampp\htdocs\apicola\public\index.php(67): MVC\Router->comprobarRutas() #5 {main} thrown in C:\xampp\htdocs\apicola\models\ActiveRecord.php on line 261