Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6575671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:24:58+00:00 2026-05-25T15:24:58+00:00

I have this function http://jsfiddle.net/wnFsE/ . As you can see every time the user

  • 0

I have this function http://jsfiddle.net/wnFsE/ . As you can see every time the user writes a languages on the textfield and then hits the button add a new language is added to the list. Then when the user hits save, all the info is sent with POST.

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.

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 $("#add").click(function() { from the PHP script who retrieve the data from the MySQL, but I don’t know how to do this.

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

function list_lang() {
    $this->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']."<br>";
        //instead of the echo, here will be the call to jquery (if possible)
    } 
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:24:59+00:00Added an answer on May 25, 2026 at 3:24 pm

    A simple soloution:

    $buildHTML = '';
    
    while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $buildHTML .= '<li>'.$row['lang'].'<input type="hidden" name="languages[]" value="'.$row['lang'].'" /><a href="#" class="remove_lang">Remove</a></li>';
    }
    

    And then have

    <script type="text/javascript">
        var UserLangs = <?php echo $buildHTML; ?>;
    
        $('#langs').append(UserLangs);
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this slide function http://jsfiddle.net/g7LwM/1/ How can I add fade effect to it?
I have this code I'm working on, see link: http://jsfiddle.net/PqsAD/3/ The problem is depending
I have this setup: http://jsfiddle.net/patrioticcow/yJPGa/5/ I can't figure out how how to toggle in
I have this script: http://jsfiddle.net/NV2uV/ It works, but I do not like it. Cons:
All of this is code is here: http://jsfiddle.net/yrgK8/ I have a news section which
I have this fiddle which has an error --> http://jsfiddle.net/Osoascam/AkZZr/6/ (This is the version
I have this fiddle: http://jsfiddle.net/y8Uju/5/ I am trying to save the numbers, because, when
I have this form: http://jsfiddle.net/michelejs/Pt6LQ/ The problem is that I am not be able
I have this fiddle http://jsfiddle.net/jdsans/38GFS/ which I was trying to workout but I could
i have this setup: http://jsfiddle.net/patrioticcow/XnnvD/ what i want to accomplish is when i hover

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.