Call a jQuery function with input data that comes from a PHP script
<p>I have this function <a href="http://jsfiddle.net/wnFsE/" rel="nofollow">http://jsfiddle.net/wnFsE/</a> . As you can see every time the user writes a languages on the textfield and then hits the button <em>add</em> a new language is added to the list. Then when the user hits save, all the info is sent with <strong>POST</strong>.</p>

<p>Until now, everything is ok. BUT, when the user sends the info, the info is stored on my MySQL database. So, every time when the user comes again to the page, he needs to see the languages already saved in the last session.</p>

<p>In my PHP script every time the user comes, I retrieve the languages from my database, but I don't know how to add them to the list. The solution would be call the <code>$("#add").click(function() {</code> from the PHP script who retrieve the data from the MySQL, but I don't know how to do this.</p>

<p>If it serves for any help, this is the simple PHP function which retrieves the languages from the user:</p>

<pre><code>function list_lang() {
    $this-&gt;DBLogin();
    $result = mysql_query("SELECT * FROM ".table_lang." WHERE id_user=1");
    while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        echo $row['lang']." ".$row['level']."&lt;br&gt;";
        //instead of the echo, here will be the call to jquery (if possible)
    } 
}
</code></pre>
