ReferenceError: show_agent_stats not defined
<p>I am trying to show a MySQL table query in a script that gets shown on a button click. When the button is clicked it calls a function that outputs to a DIV tag. The function is in another script page called functions.php and is included at the top of the current page vicidial.php. When the button is clicked i get the above error message, im sure its something simple but om not seeing it, here is the calling button and the DIV tag i want the results to print to;</p>

<pre><code>     (vividial.php)
    &lt;button onclick="show_agent_stats();"&gt;Hey there&lt;/button&gt;
    &lt;div id="agent_stats"&gt;&lt;/div&gt;

     (functions.php)
      function show_agent_stats(){

    ?&gt;

    &lt;script type="text/javascript"&gt;
    var oldHTML = document.getElementById("agent_stats").innerHTML;
    var newHTML = "&lt;?php include("dbtable.php");?&gt;";
        return document.getElementById("agent_stats").innerHTML= newHTML;


            &lt;?php
            }
</code></pre>

<p>any help finding the source of this error is greatly appreciated. Thanks in advance</p>
