Split an array of ids and save it as individual rows in table
You can use db_insert in your module OR drupal_write_record

E.g: drupal 7 code



 //Assuming your array is like
 /*
   $ids = array(1,2,3,4,5,6,....);
 */

  // Traversing ids by using foreach loop
  foreach($ids_array as $key=>$value){
       $custom_table_data = array(
            'id'=>$value,// id value
            'column1'=>'..'
        );

       // INSERT INTO {table_name} (field_1, field_2, ...) VALUES ('ABC', '123', ....)
        $nid = db_insert('table_name') // Table name no longer needs {}
        ->fields($custom_table_data)
        ->execute();

        // OR using drupal_write_record... 
        drupal_write_record('table_name', $custom_table_data);
  }