What seems to be the problem ?, do you get errors or just no results ?
Sorry, its pretty difficult to decipher without having the tables and data.
Can you dump you tables with sample data ? and/or do you have a link to the page ?
If it is the WHERE clause, this just acts as the filter, so try removing it.
If you then get some rows returned then at least your sql statement is correct and it is just your WHERE clause