1. Это вопрос к теме :)
2. Не знаю что делали но вот код добавления
if (isset($data['record_related'])) {
foreach ($data['record_related'] as $related_id) {
$this->db->query("INSERT INTO " . DB_PREFIX . "record_related SET pointer_id = '" . (int) $record_id . "', related_id = '" . (int) $related_id . "' , pointer='record_id'");
$this->db->query("INSERT INTO " . DB_PREFIX . "record_related SET pointer_id = '" . (int) $related_id . "', related_id = '" . (int) $record_id . "' , pointer='record_id'");
}
}
....
if (isset($data['product_related'])) {
foreach ($data['product_related'] as $product_id) {
$this->db->query("INSERT INTO " . DB_PREFIX . "record_related SET pointer_id = '" . (int) $record_id . "', related_id = '" . (int) $product_id . "' , pointer='product_id'");
$this->db->query("INSERT INTO " . DB_PREFIX . "record_related SET pointer_id = '" . (int) $product_id . "', related_id = '" . (int) $record_id . "' , pointer='product_id'");
}
}