Puedes hacer todo junto, es suficiente hacer un control pienso
Código PHP:
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$update_string = "UPDATE candidato SET idProvincia=%s, nombre=%s, apellidos=%s, direccion=%s, poblacion=%s, cp=%s, fechaNacimiento=%s, lugarNacimiento=%s, telefono=%s, movil=%s, email=%s";
if($_POST['estadoCivil']) $update_string .= ", estadoCivil=%s";
$update_string .= ", numHijos=%s WHERE nifCandidato=%s";
$updateSQL = sprintf($update_string,
GetSQLValueString($_POST['provincia'], "int"),
GetSQLValueString($_POST['nombre'], "text"),
GetSQLValueString($_POST['apellidos'], "text"),
GetSQLValueString($_POST['direccion'], "text"),
GetSQLValueString($_POST['poblacion'], "text"),
GetSQLValueString($_POST['cp'], "text"),
GetSQLValueString($_POST['fechaNacimiento'], "date"),
GetSQLValueString($_POST['lugarNacimiento'], "text"),
GetSQLValueString($_POST['telefono'], "text"),
GetSQLValueString($_POST['movil'], "text"),
GetSQLValueString($_POST['email'], "text"),
if($_POST['estadoCivil']) GetSQLValueString($_POST['estadoCivil'], "int"), // mi duda, no se si eso se puede hacer como que nunca utilize sprintf
GetSQLValueString($_POST['numHijos'], "int"),
GetSQLValueString($_POST['nifCandidato'], "text"));
mysql_select_db($database_conexionETT, $conexionETT);
$Result1 = mysql_query($updateSQL, $conexionETT) or die(mysql_error());
}
Ciao!