Good afternoon, I managed to sort this out. I have amended my functions.php to the following. function mcPaySubmit(){ global $wpdb; include(‘paygate.php’); $last = wp_get_recent_posts(array(‘numberposts’ => ‘1’, ‘post_type’ => ‘post’, ‘post_status’ => ‘pending’, ‘author’ => $user_id)); $purchase_post_id = $last[‘0’][‘ID’]; $purchase_days = $_POST[‘dext’]; $purchase_date = $_POST[‘mcTransactionDate’]; $purchase_amount = $_POST[‘totalDue’]; if($wpdb->insert(‘ac_purchases’, array( ‘purchase_post_id’ => $purchase_post_id, ‘purchase_days’ => $purchase_days, … Read more