I didn't think this would give me any trouble, but it is. I just want to run a query depending on the URL segments.
I have this now:
{if segment_3 != ''}
{exp:query sql="SELECT a.cat_id, a.parent_id, b.cat_name FROM exp_categories a, exp_categories b WHERE a.cat_url_title = '{segment_3}' AND b.cat_url_title = '{segment_2}'"}
{if:else}
{exp:query sql="SELECT cat_id, parent_id FROM exp_categories WHERE cat_url_title = '{segment_2}'"}
{/if}
...
{/exp:query}
But every time I wrap it in the IF statement, I get nothing...