I have been trying to insert some fields from a gravity forms submission into a custom WP database and can't seem to get the fields to populate.
// create a past speaking event
add_action( 'gform_after_submission_8', 'add_past_speaking_event', 10, 2 );
function add_past_speaking_event($entry, $form) {
global $wpdb;
$author = $entry[1];
$postID = $entry[9];
$eventTitle = $entry[6];
$event_description = $entry[8];
$tablename ="wp_past_speaking_events";
$wpdb->insert($tableName, array('event_id'=> NULL, 'post_id' => $postID, 'author' => $author, 'event_title' => $eventTitle, 'event_description' => $event_description), array('%d', '%d', '%s', '%s', '%s'));
}
I have echoed the $author, $postID etc. and they are all populated with the right data. And I get a success message after form submission. But when I check the DB I don't see any new entries.
This code is placed in the functions.php file of my child theme.
Any help appreciated.