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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:53:32+00:00 2026-06-01T04:53:32+00:00

Im having a list of student names in a table , in the same

  • 0

Im having a list of student names in a table , in the same table each student name has a check-box , the user will have to check the check-box to add this students in the course , so I want to save the students ID of those who have checked check-box , but it seems that I got nothing in the array !
here is the code

echo "<form action='S7.php' method='post'> <table width='40%' border='1' cellpadding='5'>
 <tr>
     <td>Check to add to course</td>
     <td>Student ID</td>
     <td>Student Name</td>
</tr> ";

 while ($row = mysql_fetch_assoc($query)){
 echo '
   <tr>
      <td> <input type="checkbox" name="foo['.$row['St_ID'].']" value=""> </td>
      <td>'.$row['St_ID'].'</td>
      <td>' .$row[First].' ' .$row[Last].'</td>
   </tr>';
  };

    echo "</table>";

   echo ' <input type="submit" name="submit" value="Add To Course" /> </form> ';
  • 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-01T04:53:33+00:00Added an answer on June 1, 2026 at 4:53 am

    The input must be like this:
    All the checkbox must have the same name, the value is different.

    <input type="checkbox" name="foo[]" value="'.$row['St_ID'].'" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Entity Framework class called Student. It has a list of Classes.
Having a list of data object and something visual to represent each, where would
Here i am having a unordered list displaying two columns code and name .I
Having a bit of trouble using the List.Find with a custom predicate i have
I have an SQL table that links students to classes. This table primarily has
I'm having syntax troubles. public class Student { int StudentId; string Name; } public
My iphone App shows a table view having list of 6000 items. (these items
I am having a list of machine ips in a ant property. <property name=machines
I am having a list in the name 'bestforproglist'. Also I had a for
I am having some trouble as follows: When i add a new user, it

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.