[eluser]introvert[/eluser]
[quote author="OverZealous" date="1279065998"]@introvert
Well, you are doing it wrong. If you read the docs, you'll see that get_sql wipes out the current query. If you want to see the generated query, then you should use check_last_query, as outlined in the troubleshooting page of the manual.
Everything that DMZ is doing is exactly what you asked it to do.
[/quote]
What am I doing wrong with the rest of the code so that I don't get the expected result?
check_last_query will return:
Code:
SELECT *
FROM (`groups`)
WHERE `updated` >= DATE_SUB(NOW(), INTERVAL 10 MINUTE)
OR
`groups`.`running` = 1
ORDER BY `groups`.`updated` ASC
SELECT *
FROM (`groups`)
WHERE `updated` >= DATE_SUB(NOW(), INTERVAL 10 MINUTE)
OR
`groups`.`running` = 1
ORDER BY `groups`.`updated` ASC