Zamień:
$casting = 'casting_field_'.$row['casting_id'].'';
$castingtitle = $this->request['casting_field_'.$row['casting_id'].''];
Na:
$casting['casting_field_' . $row['casting_id']] = $this->request['casting_field_' . $row['casting_id']];
Następnie utwórz te "stałe" klucze tablicy:
$insert = array(
'casting_member_id' => $this->memberData['member_id'],
'casting_date' => IPS_UNIX_TIME_NOW,
'casting_member_join' => $this->memberData['joined'],
'casting_warn_level' => $this->memberData['warn_level'],
'casting_content' => $editor->process( $_POST['appeal'] )
);
Potem dodajesz te klucze "dynamiczne":
foreach($casting as $key => $value)
{
$insert[$key] = $value;
}
I wykonujesz zapytanie:
$this->DB->insert( "casting_appeal", $insert );