SQL error with custom query
Should be: $where .= ” AND voted > 1″; Other notes: instead of hardcoding table names you should use $wpdb->prefix . ‘post_votes’; instead of checking in global $_GET you should declare your filters as accepting two arguments and code functions accordingly, these filters pass as second argument object that contains all of query data. Like: … Read more