Title: CPT with custom datatable insert, update
Last modified: March 12, 2020

---

# CPT with custom datatable insert, update

 *  [labyrinthman](https://wordpress.org/support/users/labyrinthman/)
 * (@labyrinthman)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/cpt-with-custom-datatable-insert-update/)
 * Hello,
 * I have a CPT with ACF and I have managed to get those fields to save to a custom
   datatable.
    How can I update the same ACF values, with same post_id, while I’m
   updating the CPT. Here is what I have done so far. Now how to update this?
 *     ```
       add_action('acf/save_post', 'my_acf_save_post');
         function my_acf_save_post( $post_ID ) {
                       global $wpdb;
       	        $table = $wpdb->prefix.'analiza';
                       $ime_radnika_1 = get_field('ime_radnika_1', $post_ID);
       		$data = array('post_ID'=>$post_ID,'name' => $ime_radnika_1);
       		$format = array('%d','%s');
       		$wpdb->insert($table,$data,$format);
       }
       ```
   

Viewing 1 replies (of 1 total)

 *  [Carike](https://wordpress.org/support/users/carike/)
 * (@carike)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/cpt-with-custom-datatable-insert-update/#post-12537202)
 * Please ask your question here: [https://wordpress.org/support/plugin/advanced-custom-fields/](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * Good luck :fourleafclover:

Viewing 1 replies (of 1 total)

The topic ‘CPT with custom datatable insert, update’ is closed to new replies.

## Tags

 * [ACF](https://wordpress.org/support/topic-tag/acf/)
 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [datatable](https://wordpress.org/support/topic-tag/datatable/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [Carike](https://wordpress.org/support/users/carike/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/cpt-with-custom-datatable-insert-update/#post-12537202)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
