My Function isn't working in my sql check
<p>I'm trying to use a function inside a function but it won't work. I'm trying to send a pop up saying you have a new message after the mysql check. It shows the div when a new message comes but when pressing the x it wont go away.    </p>

<pre><code>function newmessage(){
    include ("safe.php");
    $get_pms = mysql_query("SELECT `id` FROM `pm` WHERE `to`='".$_SESSION['uid']."' AND `seen`='0'") or die (mysql_error());
    if(mysql_num_rows($get_pms) &gt; 0){
        echo "&lt;div style='display:block;' class='alert'&gt;
          &lt;span class='closebtn' onclick='this.parentElement.style.display='none';'&gt;&amp;times;&lt;/span&gt;
          &lt;strong&gt;Danger!&lt;/strong&gt; Indicates a dangerous or potentially negative action.
&lt;/div&gt;";
    } else {
        echo "&lt;font id=\"clr\" size=\"1px\" color=\"red\"&gt;&lt;b&gt;&lt;/b&gt;     &lt;/font&gt;";
    }
}
</code></pre>