get_row($wpdb->prepare("SELECT * FROM {$wpdb->prefix}aistore_books_payment where user_id=%s and company_id=%s", $user_id,$company->id)); // print_r($results); if (isset($_POST['submit']) and $_POST['action'] == 'payment_system') { if (!isset($_POST['aistore_nonce']) || !wp_verify_nonce($_POST['aistore_nonce'], 'aistore_nonce_action')) { return _e('Sorry, your nonce did not verify', 'aistore'); exit; } $payment_instructions = sanitize_text_field($_REQUEST['payment_instructions']); if($results !== null){ $pid = $results->id; $wpdb->query($wpdb->prepare("UPDATE {$wpdb->prefix}aistore_books_payment SET payment_instructions = '%s' WHERE company_id = '%d' and user_id=%s", $payment_instructions, $company->id,$user_id)); $message='Update Payment Successfully'; } else{ $wpdb->query($wpdb->prepare("INSERT INTO {$wpdb->prefix}aistore_books_payment ( payment_instructions, company_id,user_id ) VALUES (%s,%s,%s)", array( $payment_instructions, $company->id, $user_id ))); $pid = $wpdb->insert_id; $message='Add Payment Successfully'; } sendNotification($pid,$message) ?> get_option('aistore_add_product') , ) , home_url())); ?>