get_results( "SELECT * FROM {$wpdb->prefix}pmxi_history WHERE import_id = {$import_id} ORDER BY id DESC LIMIT 1" ); foreach ( $results as $history ){ $history_data[] = array( 'id' => $history->id, 'type' => $history->type, 'time_run' => $history->time_run, 'date' => $history->date, 'summary' => $history->summary ); } return $history_data; }