Im trying to implement a tag-based search. When i specify certain tags, tagged posts will be searched and the post-id will be displayed that matches the searchcriteria.

Currently it only works for a single tag.

$query = "SELECT DISTINCT $wpdb-&gt;posts.ID FROM $wpdb-&gt;terms
    LEFT JOIN $wpdb-&gt;term_taxonomy ON ($wpdb-&gt;terms.term_id = $wpdb-&gt;term_taxonomy.term_id)
    LEFT JOIN $wpdb-&gt;term_relationships ON ($wpdb-&gt;terms.term_id = $wpdb-&gt;term_relationships.term_taxonomy_id)
    LEFT JOIN $wpdb-&gt;posts ON ($wpdb-&gt;term_relationships.object_id = $wpdb-&gt;posts.ID)
        WHERE $wpdb-&gt;term_taxonomy.taxonomy = 'post_tag' " . $substring;


Substring looks like following:

$substring = "AND $wpdb-&gt;terms.slug IN ('tag1','tag2')"


And here is the problem. It does not look for single posts that match all criteria. Instead it 'collects' all posts with all tags searched.

For example:

// postid1 -&gt; tag1
// postid2 -&gt; tag2
// postid3 -&gt; tag1, tag2

$substring = "AND $wpdb-&gt;terms.slug IN ('tag1')"
//Output: postid1, postid3 - - - CORRECT
$substring = "AND $wpdb-&gt;terms.slug IN ('tag1','tag2')"
//Output: postid1, postid2, postid3 - - -WRONG!

//Expected: postid3


So far i have no idea howto solve it in a single mysql query. Maybe im missing something.
Thanks for your help in advance.


Question: On the singularity $r=0$ of the Schwarzschild metric
Answer: I believe that both questions are easily answered even without a GR background. Saying that something is an artifact of spherical symmetry means, in this context, that it was expected that the singularity would not occur in cases where no perfect symmetry is assumed. Since perfect spherical symmetry only ever occurs in theory, this would solve the problem of the singularity: it would never appear in practice. The real-life case is referred to as 'generic', denoting pretty much that it does not have any special properties (like perfect spherical symmetry) associated with it.