Guest User

Untitled

a guest
Aug 7th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. PHP to MySQL drop down list no longer passing value
  2. <tr><td align='right'>Mother Tongue:</td>
  3. <td><select name="MotherTongue">
  4. <?
  5. while($row = mysql_fetch_array($mothertonguesql)) {
  6.  
  7. if ($row['Language'] == $mothertongue){
  8. ?>
  9. <option selected value="<?=$row['Language']?>"><?=$row['Language']?></option>
  10. <?
  11. }
  12. else {
  13. ?>
  14. <option value="<?=$row['Language']?>"><?=$row['Language']?></option>
  15. <?
  16. }}
  17. ?>
  18. </select>
  19. </td>
  20. </tr>
  21.  
  22. $MotherTongue=$_POST['MotherTongue'];
  23. $MotherTongue = mysql_real_escape_string($MotherTongue);
  24.  
  25. $sql="UPDATE Teacher SET Password='$Password', FirstName='$FirstName', Surname='$Surname', Address1 = '$Address1', Address2='$Address2', PLZ='$PLZ', City='$City', Country='$Country', TelNo='$TelNo', EmailAddress='$EmailAddress', MotherTongue='$MotherTongue', CanTeachLang1='$CanTeachLang1', CanTeachLang2='$CanTeachLang2', CanTeachLang3='$CanTeachLang3', CanTeachLang4='$CanTeachLang4', CanTeachLang5='$CanTeachLang5', Profile='$Profile', HourlyRate='$HourlyRate', TeachingAddress='$TeachingAddress', WillTravelToStudent='$WillTravelToStudent', idMailFrequency = '$idMailFrequency' WHERE Username = '$Username'";
  26.  
  27.  
  28. if (!mysql_query($sql, $link))
  29. {
  30. die('Error:' . mysql_error());
  31. }
Add Comment
Please, Sign In to add comment