prepare("UPDATE provincias SET nombre = ? WHERE id = ?"); $stmt->bind_param('si', $nombre, $id); $stmt->execute(); $_SESSION['success_message'] = "Provincia actualizada."; } // Handle new insertion if (isset($_POST['new_provincia_nombre'])) { $nombre = $_POST['new_provincia_nombre']; if (!empty($nombre)) { $stmt = $db->prepare("INSERT INTO provincias (nombre) VALUES (?)"); $stmt->bind_param('s', $nombre); $stmt->execute(); $_SESSION['success_message'] = "Provincia agregada."; } } header("Location: info_producto.php"); exit(); ?>