question what version are you on
i am on the 1 befor the lest beta
this is what i have in there
/* Proper timestamp */
$pirepdata['flighttime'] = str_replace(':', '.', $pirepdata['flighttime']);
$pirepdata['flighttime_stamp'] = str_replace('.', ':', $pirepdata['flighttime']).':00';
/* Export status as 0 */
$pirepdata['exported'] = 0;
$pirepdata['submitdate'] = 'NOW()';
$pirepdata['accepted'] = PIREP_PENDING;
$pirepdata['expenselist'] = '0';
# Do the insert based on the columns here
$cols = array();
$col_values = array();
foreach($pirepdata as $key => $value)
{
switch($key)
{
case 'submitdate':
$cols[] = "`{$key}`";
$col_values[] = 'NOW()';
break;
case 'comment':
continue;
break;
default:
$cols[] = "`{$key}`";
$value = DB::escape($value);
$col_values[] = "'{$value}'";
break;
}
}
$cols = implode(', ', $cols);
$col_values = implode(', ', $col_values);
$sql = 'INSERT INTO '.TABLE_PREFIX."pireps ({$cols}) VALUES ({$col_values});";
DB::query($sql);
$pirepid = DB::$insert_id;