Reply to Re: My first php program

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация