09.12.2015, 23:35
Use print to see the actual query itself. This will make it easier to find the problem in the query.
If it's not easy to spot, post it here and I'll have a look.
If it's not easy to spot, post it here and I'll have a look.