Problem with PHP and MySQL
So guys, I need your help for a school-project.
We must build a database+interface where our teachers may enter marks for their students. Basically we need to create a database with MySQL and then get & set data with PHP in a HTML based Web-Layout. I have the basic concept and realization down but now I have a problem with submitting some data I get from the database to another .php-doc. I want to submit the ID of a specific course to the next .php-site where it will be used to show the user all the students that are in that specific course. I want to do it via radiobuttons. You select the radiobutton of the course you want to be shown and it's ID gets submitted. The code for it looks like this:
I've figured that the problem must lie in the:
,section of the <input>-form. I think that I can't just write the $row->ID_C into the quotationmarks, but I need the value of the radiobutton to be the ID of a specific class to submit it to the next page.
So does someone have an idea how I could do that?
Thanks, and sorry for the long post! :)
We must build a database+interface where our teachers may enter marks for their students. Basically we need to create a database with MySQL and then get & set data with PHP in a HTML based Web-Layout. I have the basic concept and realization down but now I have a problem with submitting some data I get from the database to another .php-doc. I want to submit the ID of a specific course to the next .php-site where it will be used to show the user all the students that are in that specific course. I want to do it via radiobuttons. You select the radiobutton of the course you want to be shown and it's ID gets submitted. The code for it looks like this:
$result = mysql_query("SELECT * FROM class");
echo '<form action="class_pupil_site.php" method="post">';
echo '<fieldset>';
echo '<legend>','Select Class','</legend>';
while($row = mysql_fetch_object($result) )
{
echo '<label>','<input type="radio" name="Class" value="$row->ID_C" />',$row->Year,$row->Name,'</label>';
echo '<br/>';
}
echo '<input type="submit" name="formaction" value="Select" />';
echo '</fieldset>';
echo '</form>';
I've figured that the problem must lie in the:
value="$row->ID_C"
,section of the <input>-form. I think that I can't just write the $row->ID_C into the quotationmarks, but I need the value of the radiobutton to be the ID of a specific class to submit it to the next page.
So does someone have an idea how I could do that?
Thanks, and sorry for the long post! :)

