Hi all,
Can any give assistance with the following?
At the moment i have this code:
<form method="post" action="admin.php">
<p><strong>Current Positions:</strong> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$result_pos = mysql_query("SELECT lady_id,first_name,last_name FROM ladies");
$total_pos = mysql_num_rows($result_pos);
while ($row_pos = mysql_fetch_array($result_pos)) {
$lady_id = $row_pos["lady_id"];
$first_name = $row_pos["first_name"];
$last_name = $row_pos["last_name"];
?>
<tr>
<input name="total_pos" type="hidden" value="<? echo $total_pos ?>">
<input name="lady_id" type="hidden" value="<? echo $lady_id ?>">
<td><? echo $first_name ?></td>
<td><input name="last_name" type="text" value="<? echo $last_name ?>"></td>
</tr>
<?
}
?>
</table>
<br>
<input name="update_position" type="submit" value="Update">
</form>
After pressing the "Update" button i want to echo the results. This is where the results are displaying incorrectly.
Here is the code:
if($update_position){
$num = 1;
while ($num <= $total_pos){
echo"$lady_id $last_name<br>";
$num++;
}
}
The only results being displayed is the last row results from the database, not once but 6 times (the value for $total_pos, which in this case is 6).
Can anyone tell me how to get it to display the different results properly?
Cheers,
micmac