WordPress simple custom update query
global $wpdb;
$tablename = $wpdb->prefix . ‘tablename';
$sql = $wpdb->prepare(“UPDATE `”.$tablename.”` SET `status` = %s WHERE id = %d”, ‘A’, id);
$tablename = $wpdb->prefix . ‘tablename';
$sql = $wpdb->prepare(“UPDATE `”.$tablename.”` SET `status` = %s WHERE id = %d”, ‘A’, id);
$wpdb->query($sql);
No comments:
Post a Comment