Created
May 1, 2012 20:21
-
-
Save ringmaster/2571063 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array ( | |
0 => 'SELECT | |
{posts}.id AS id, | |
{posts}.slug AS slug, | |
{posts}.title AS title, | |
{posts}.guid AS guid, | |
{posts}.content AS content, | |
{posts}.cached_content AS cached_content, | |
{posts}.user_id AS user_id, | |
{posts}.status AS status, | |
{posts}.pubdate AS pubdate, | |
{posts}.updated AS updated, | |
{posts}.modified AS modified, | |
{posts}.content_type AS content_type | |
FROM | |
{posts} | |
JOIN {object_terms} join_1_ot ON {posts}.id = join_1_ot.object_id | |
JOIN {terms} join_1_t ON join_1_ot.term_id = join_1_t.id | |
JOIN {vocabularies} join_1_v ON join_1_t.vocabulary_id = join_1_v.id | |
JOIN {object_terms} join_2_ot ON {posts}.id = join_2_ot.object_id | |
JOIN {terms} join_2_t ON join_2_ot.term_id = join_2_t.id | |
JOIN {vocabularies} join_2_v ON join_2_t.vocabulary_id = join_2_v.id | |
WHERE | |
( | |
join_1_v.name = :param_1 | |
AND | |
join_1_t.id = :param_2 | |
AND | |
join_1_ot.object_type_id = :param_3 | |
AND | |
join_2_v.name = :param_4 | |
AND | |
join_2_t.id = :param_5 | |
AND | |
join_2_ot.object_type_id = :param_6 | |
) | |
GROUP BY {posts}.id,{posts}.slug,{posts}.title,{posts}.guid,{posts}.content,{posts}.cached_content,{posts}.user_id,{posts}.status,{posts}.pubdate,{posts}.updated,{posts}.modified,{posts}.content_type | |
HAVING count(*) = 1 | |
ORDER BY pubdate DESC', | |
1 => | |
array ( | |
'param_1' => 'fizz', | |
'param_2' => 372, | |
'param_3' => 1, | |
'param_4' => 'buzz', | |
'param_5' => 373, | |
'param_6' => 1, | |
), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment