I've made an email script that should update as soon as wp_mail has result. For some reason my value won't update. Have I missed something? I am receiving the mail so the wp_mail works.
Cheers!
$email_result = wp_mail( $to, $subject, $message, $headers );
if( $email_result ){//wp_mail() processed the request successfully
global $wpdb;
$table_name = $wpdb->prefix . "wpsc_coupon_codes";
$coupon_id = $ereminder->ID;
$ereminders = $wpdb->query( $wpdb->prepare("
UPDATE *
FROM $table_name
SET reminder = 1
WHERE ID = $coupon_id
") );
}
Try This:
$wpdb->update( $table_name, array( 'reminder' => 1),array('ID'=>$coupon_id));
try this
UPDATE $table_name
SET reminer = 1
WHERE ID = $coupon_id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With