Greetings.
With the select box below I get the correct current information for the blood field.
Problem is when I submit the form with a modified selection the blood field isn't updated in the relevant record.
I've tried a variety of ways to advise the update to include the new information but I only end up with a blank entery or no change at all.
I've included a snippet of the script - enough so no one thinks I have no idea.
Any suggestions as to the code and not to my skills itself would be appreciate.
First page
<?
$result=mysql("$DBName","SELECT * FROM Data WHERE id='$id'");
echo "<table border='0' cellpadding='10' cellspacing='10'>";
while ($row = mysql_fetch_row($result)) {
$FN=$row[0];
$LN=$row[1];
$BL=$row[2];
}
echo "<FORM ACTION=\"$Relative/addcartal.php?UID=$UID\" METHOD=\"POST\">";
fontSize("-1","#CC0033","Arial","First Name:*<br>");
echo "<input type=\"text\" name=\"FirstName\" VALUE=\"$FN\" size=\"40\"><p>";
fontSize("-1","#CC0033","Arial","Last Name:*<br>");
echo "<input type=\"text\" name=\"LastName\" VALUE=\"$LN\" size=\"40\"><p>";
$sel_text = 'selected="selected"';
?>
<table>
<tr bgcolor="#FFFF44">
<td><font face="Arial, Helvetica, sans-serif" size="2" color="blue"> Blood Group : </font></td>
<td><font face="Arial, Helvetica, sans-serif" size="2">
<select name=\"Blood\">
<option value="A+"<? if ($BL == 'A+') echo $sel_text; ?>>A+</option>
<option value="A-"<? if ($BL == 'A-') echo $sel_text; ?>>A-</option>
<option value="B+"<? if ($BL == 'B+') echo $sel_text; ?>>B+</option>
<option value="B-"<? if ($BL == 'B-') echo $sel_text; ?>>B-</option>
<option value="AB+"<? if ($BL == 'AB+') echo $sel_text; ?>>AB+</option>
<option value="AB-"<? if ($BL == 'AB-') echo $sel_text; ?>>AB-</option>
<option value="O+"<? if ($BL == 'O+') echo $sel_text; ?>>O+</option>
<option value="O-"<? if ($BL == 'O-') echo $sel_text; ?>>O-</option>
<option value="Unknown"<? if ($BL == 'Unknown') echo $sel_text; ?>>Unknown</option>
</select>
</font></td>
</tr></table>
<?
echo "</td><td><INPUT TYPE=\"SUBMIT\" VALUE=\"Submit Details\"></td></tr></table></FORM>";
?>
Second page:
<?
mysql_connect("$DBHost","$DBUser","$DBPass");
mysql("$DBName","UPDATE Data SET FirstName='$FirstName' WHERE id='$id'");
mysql("$DBName","UPDATE Data SET LastName='$LastName' WHERE id='$id'");
mysql("$DBName","UPDATE Data SET Blood='$Blood' WHERE id='$id'");
Header("Location: $Relative/viewcarta.php?UID=$UID&username=$username");
?>