check if true fails. Return true but doesn't evaluate
<p>I have a function that check if a user has a specific functionality enabled in his role.</p>

<pre><code>function uar($role,$func,$pdo){
    $id = '';
    $id = $pdo-&gt;query("SELECT id FROM ruolo_funzione WHERE ruolo='$role' AND funzione='$func'")-&gt;fetchColumn();
    if($id!=''){
        return true;
    }else{
        return false;
    }
}
</code></pre>

<p>If I run the query directly it returns an $id so the function returns true.
In the menu page I check if it returns true or false:</p>

<pre><code>&lt;?php if(uar($_SESSION['ruolo'],38,$pdo)){?&gt;
    &lt;li class="subitem1"&gt;
    &lt;a href="index.php?area=soff&amp;sub=home"&gt;Dashboard&lt;/a&gt;
    &lt;/li&gt;
&lt;?php } ?&gt;
</code></pre>

<p>but it doesn't display anything. What is wrong with my code? what do I miss to get it working?</p>

<p>EDIT:
from mysql log one of the queries is:</p>

<pre><code>SELECT id FROM ruolo_funzione WHERE ruolo='5' AND funzione='38'
</code></pre>

<p>that returns an id (checked) but doesn't evaluate to true</p>