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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:01:39+00:00 2026-05-30T22:01:39+00:00

Hi I have senario where i need to update the MySQL table which has

  • 0

Hi I have senario where i need to update the MySQL table which has student ID and Student Marks. Now the Student ID is unique here. How do I use only one form to update all the students marks.

$result= mysql_query("SELECT fname,usn FROM student where branch='$branch' and section='$section' and semester='$semester'") or die(mysql_error());  
    echo "<form action=\"marks.php\" method=\"POST\">";
    echo "<table border='6' width='500' cellspacing='10' cellpadding='10' style='font-size:14px'>";
     echo "<caption>";
     echo "<b style='font-size:18px'>Internal</b> ";
     echo "<b style='font-size:18px'>";
     echo $internal;
     echo "</b>";
     echo " <b style='font-size:18px'>marks of</b> ";
     echo "<b style='font-size:18px'>";
     echo $subject;
      echo "</b>";
     echo "</caption>";
     echo "<tr><th>USN</th><th>FNAME</th><th>MARKS</th></tr>";

    // keeps getting the next row until there are no more to get
    while($row = mysql_fetch_array( $result )) {
    echo "<tr><td>";
    echo $row['usn'];
    echo "</td><td>";
    echo $row['fname'];
    echo "</td><td>";
    echo "<input name=\"internal\" type=\"text\"  value=\"\" >";
    echo "</td></tr>";
    echo "</table>";

    echo "<input name=\"update\"  id=\"update\"type=\"submit\"  value=\"submit \"align=\"middle\" >";
  • 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-30T22:01:40+00:00Added an answer on May 30, 2026 at 10:01 pm

    Each time you print out the input field for the student mark, you could print a name attribute for the input field that uniquely identifies it – using an integer counter, for example, from 0 to N-1, where N is the number of students. You could also pass a hidden input field with the total number of students. The PHP code that receives the data then uses the hidden input field to loop over the input fields in the form data.

    For example, if the input fields end up being named FIELD0 … FIELD20, then the hidden input field has value 21, so the PHP code simply says this:

    $marks = array();
    for ($i = 0; $i < $NUMOFMARKS; $i++) {
        $marks[] = $POST['FIELD' . $i];
    }
    

    Then build your SQL query from the array of marks.

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

Sidebar

Related Questions

Here's the scenario.... I have a MySQL table (called fixtures) with the following.... You
I have a table which has id and statement columns, statement column contains statement
I have 3 tables, i need to update 3rd table's column by calculating data
I have a scenario where I need to update a list item, but I
I have a scenario where i need to Implement triggers for Update and Insert
scenario: you need to update 2 fields of a customer you don't have a
I have a MySQL(innodb) table 'items' with the following characteristics Large number of rows,
I need help with a common senario..... I have a central database or datastore
Here is the scenario: I have several .pfx files and I need to store
I have scenario where I need to host a web service (WCF) on Azure

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.