Forums

mysql query .. please help me (1 post)

  1. br0s98
    Member
    Posted 3 years ago #

    hi.

    -----------------------------------------------------------------
    function deleteNoMatchPosts(){
    global $wpdb;
    $wpdb->query("DELETE FROM $wpdb->posts WHERE post_title NOT LIKE '%favourite%' ");
    $wpdb->query("DELETE FROM $wpdb->posts WHERE post_title NOT LIKE '%favourite1%' ");
    $wpdb->query("DELETE FROM $wpdb->posts WHERE post_title NOT LIKE '%favourite2%' ");
    }

    add_action('save_post', 'deleteNoMatchPosts');

    -----------------------------------------------------------------

    i write that code to delete post title that not match certain string.

    but before do DELETE FROM blabla..

    i want to select only post_title that are created past certain date say May 1 2009.

    please help. thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags