Posted by spacerat on 10/16/06 15:12
forgive me for my ambuguity
by actual code is as follows
======START=====
<?php
require_once ('./includes/site_globals.inc.php');
$subject = $_SESSION['Subject'];
$year = $_SESSION['Year'];
$semester = $_SESSION['Semester'];
//Get all classes for a given subject , in an occurance of a
year/semester
$results = $db->GetAll("SELECT *
FROM classcode c
WHERE subject = '$subject' AND year = '$year' AND semester =
'$semester'");
?>
<?php if ( !$results ) { ?>
<?php echo "There are currently no subjects to allocate for"; ?>
<?php } else { ?>
<link href="css/ames.css" rel="stylesheet" type="text/css" />
<table border="0" align="center">
<tr>
<td class="tableheader">ClassCode</td>
<td class="tableheader">Class</td>
</tr>
<form name="update_allocations" action="allocation_update_form.php"
method="post">
<div>
<?php foreach ($results as $result) { ?>
<tr>
<td class="shade"><?php echo $result['classcode']; ?></td>
<td class="shade"><?php echo $result['activity']; ?></td>
<td>
<input type="submit" name="classcode" value="<?php echo
$result['classcode']; ?>">
</td>
<?php } ?>
</tr>
</div>
</form>
</table>
<? } ?>
======END=====
this dumps it into "allocation_update_form.php"
which the main query is.
$results = $db->GetAll("SELECT *
FROM classlist c
WHERE c.subject = '$subject' AND c.year = '$year' AND c.semester =
'autumn'
AND classcode = '$classcode'");
its dumping the data ok but the problem i am is that $classcode is
always the same number. when i click on the 'submit' button.
[Back to original message]
|