{eyou:notempty name='$sql' /} {eyou:sql sql='$sql' cachetime='3600' empty='' id="res"} {eyou:php} if(!empty($res)){ $class1 = 'btn-e-active'; } {/eyou:php} {/eyou:sql} {eyou:sql sql='$sql2' cachetime='3600' empty='' id="res"} {eyou:php} if(!empty($res)){ $class2 = 'btn-e-active'; } {/eyou:php} {/eyou:sql} {/eyou:notempty}