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 7623193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:38:44+00:00 2026-05-31T04:38:44+00:00

I have a form with a variable number of inputs. The inputs are inside

  • 0

I have a form with a variable number of inputs. The inputs are inside the table and I need to get three values from them: the row, the column and the actual value inside the input.

Some may be populated some may not and I need all their values to update a mysql db (row and column to know what to update, value to know the new value to insert in the database).

This is my form (an example version of it):

<form method="post" action="">
      <input name="data[111][222]" value="2" />
      <input name="data[112][221]" value="0" />
      <input name="data[113][223]" value="4" />
      //goes on
      <input name="data[324][435]" value="11" />
      <input name="data[325][436]" value="" />
</form>

And that’s as far as I go. How can I get the data from this form so I can do a simple update in my database that goes like this (for all the affected inputs):

   update table set res="value_from_input" where row="row_value" and col="col_value"
  • 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-31T04:38:45+00:00Added an answer on May 31, 2026 at 4:38 am
    <form method="post" action="">
          <input name="data[111][222]" value="2" />
          <input name="data[112][221]" value="0" />
          <input name="data[113][223]" value="4" />
          <input name="data[324][435]" value="11" />
          <input name="data[325][436]" value="" />
          <input type="submit" />
    </form>
    <?php
    foreach ($_POST['data'] as $k1 => $v1)
    {
        foreach ($v1 as $k2 => $v2)
        {
            echo "<p>k1:".$k1."; k2: ".$k2."; value: ".$v2."</p>";
            $query = "update table set res='$v2' where row='$k1' and col='$k2'";
            mysql_query($query);
        }
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, I have a form with a variable number of inputs, a simplified version
I have a form that has 8 columns and a variable number of rows
I have an ASP.NET web form which I am adding a variable number User
We have an edit form:we populate it with a variable number of checkboxes (it
I have a public variable testStr in my applications main form. I have a
I have form with user defined filters ( combobox with column names, combobox with
i have a form that is dynamically built. so the number of form elements
I have a requirement whereby a user can specify a variable number of user-defined
I have a form that allows a user to add an unlimited number of
I need to add a $ variable to an href url, I have tried

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.