943,931 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2175
  • PHP RSS
Mar 19th, 2005
0

Programming Question Using PHP Language

Expand Post »
Hi,
I have a problem with solving a programming point.
I tried to solve it in many ways but I couldn’t

I have a system that each teacher has his username and password
Inside his profile he need to choose some students to make some groups lets say they a group for students who take mathematical language, to this point I have no problem

The problem is when I select all the students by using while loop and they displayed in the page, each student has a tick mark beside it to let the instructor select his name,

The number of students to be viewed is unknown, but it's viewed from database. Now, the instructor is checking the entire student he wants, by clicking a button the data should be save as all the group he checked, I really don’t know how to ask this, I'll try, How the check box for each student link with the student database to let me save it in other table, in other way, the select is retrieve the data and cant be linked with the new created check box. ( how can the check box know that this check is for that student)

This problem is confusing me, and I don’t know if there is a solving for it
Sana
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lady is offline Offline
1 posts
since Mar 2005
Mar 22nd, 2005
0

Re: Programming Question Using PHP Language

hey, im not quite sure if i understood what you were asking, but i may have.

you could simply name the check boxes whatever the students names are.

so inside the tag that creates the box, say name = <?= echo $studentname ?>
then when the form is processed, it will know which box applies to which student.

or something along those lines. hope this helps.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
kaiser<lucy> is offline Offline
13 posts
since Nov 2004
Mar 22nd, 2005
0

Re: Programming Question Using PHP Language

Quote originally posted by lady ...
Hi,
The problem is when I select all the students by using while loop and they displayed in the page, each student has a tick mark beside it to let the instructor select his name
I'm guessing you have a "key" for each student record in the database?

In your while loop you could do this

while ($array=mysql_fetch_array($qry)) {
etc etc
<input type=checkbox name=students[ ] value="<? echo $array["key"];?>">
Student Name
}

Then the form send an array called students, run a foreach on them and do as you please with them.

HTH
Reputation Points: 15
Solved Threads: 0
Junior Poster in Training
barnamos is offline Offline
50 posts
since Mar 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Installing a SMTP for mail()
Next Thread in PHP Forum Timeline: PHP/SQL query help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC