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

  • SEARCH
  • Home
  • 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 8093883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:36:41+00:00 2026-06-05T20:36:41+00:00

I need some advice on how to successfully update mutiple rows in my database

  • 0

I need some advice on how to successfully update mutiple rows in my database from dynamically created input fields.

So, what I have is this:

PHP

<?php
   while ($row = mysql_fetch_array($sql)) {
       echo "<input class='estemated_days' type='text' id='".$row['scpe_id']."' value='".$row['scpe_estemated_days']."'></td>";
   }
?>

This will output something like this:

HTML

<input class='estemated_days' type='text' id='718' value='5'>
<input class='estemated_days' type='text' id='719' value='8'>
<input class='estemated_days' type='text' id='720' value='10'>

<input type='button' id='save' value='Save'> <!-- Button to jQuery -->

…..etc.

Here is where my knowledge is lacking. I want jQuery to do something like this:

jQuery

($"#save").click(function () {

  // Get value of id from (".estemated_days") as an identifier, and get the input value it contains
  // Send to /update.php

});

Then, the update.php would do something like this:

PHP

<?php

if (isset($_POST['save'])) {

    /*
        Get all of the id's and the value it contain's

        perform:
    */

    mysql_query = ("UPDATE myDatabase SET estemated_days = '$the_value_from_the_input' WHERE scpe_id = '$the_value_of_the_id'");
    //Repeat this for all rows from the webpage
}

?>

My knowledge is basic web programming but I would really like to make this work. Anyone got advice on how I should do it?

  • 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-06-05T20:36:45+00:00Added an answer on June 5, 2026 at 8:36 pm
    var values = {};
    $('input.estimated_days').each(function(n, el){
       values[ $(el).attr('id') ] = $(el).val();
    });
    
    $.ajax(
      {
        type : 'POST',
        url : 'update.php',
        data : {edays: values}
      }
    ); /// see jquery docs for ajax callbacks 
    
    <?php
       foreach($_POST['edays'] as $id=>$value) // ...
    

    http://api.jquery.com/jQuery.ajax/
    also
    http://api.jquery.com/attr/

    … and don’t forget to sanitize the input for mysql

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some advice again please. This is regarding a single developer shop. I have
I need some advice how to implement this situation in my application. I have
I need some advice on a little project im doing. I have a database
I need some advice. (For those who have already read this before I have
I need some advice regarding which database I should use. I want to create
I need some advice of how to setup my tables I currently have a
I need some advice for a design which I have to implement in application.
I need some advice from experts :) I will develop a website using PHP
Sorry if this is quite a long question, i need some advice on what
Need some advice, I'm after a decent process/task manager for Ubuntu. Basically I have

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.