this is the code ive got so far
<?
$result = mysql_query( "SELECT * FROM hwkset" );
$num_rows = mysql_num_rows( $result );
print "There are currently $num_rows homework(s) set in the table<p>";
while ( $a_row = mysql_fetch_array( $result ) ) {
?>
//Display homework with checkbox at the end
<tr align=center>
<td><?echo $a_row[id]?></td><td width=70><?echo $a_row[year]?></td><td width=100><?echo $a_row[subject]?></td><td width=40><?echo $a_row[Staff]?></td><td width=250><?echo $a_row[hwkset]?></td><td width=90><?echo $a_row[date]?><td><input type="checkbox" name="tick[<? $id?>]"></td>
<?
$num++
?>
</tr>
<?
}
mysql_close( $link );
?>
</table>
<?
$n = $num;
?>
<input type=submit value="Delete Homework">
</form>
and this is wot the action of the form is
elseif($action == "del" && $password == $pass) {
if ( ! $link ) die ( "Couldn't connect to MySQL server" );
mysql_select_db( $db, $link ) or die ( "Couldn't oper $db: ".mysql_error() );
for ($k = 0; $k <= $n; $k++) {
if (trim($tick[$id]) == "") {
?>
The homwork for <?echo $id[$k]?> has been deleted successfully<br>
<?
}
else {
?>
There is no data in <?echo $k?> to be delete<Br>
<?
}
}
exit;
}
ive only but it saying text so i can make sure that if statement works before i do nething else.
but it only displays 1 line and not mutiple lines for each line it displays in the form, and i cant see why. What am i missing