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:
try this
We could use
$wpdb->update
, like this:You may change instead of (UPDATE * FROM)
and use no break.
Thank you.
Example of mine that is working: