php - Doubt using update query -
i have particular column unique in database. regarding using particular script name
field avoid duplicacy. issue if want update other field except name field query not firing. please give me proper approach this. using particular script if wish make changes in row need make changes in name field also...chk out.
if($name!="") { $sql = "select a_name t_a_list a_name = '$name'"; $result = mysql_query($sql); if(mysql_num_rows($result) != 0) { $msg = "<font color=red>record not saved. album exist!</font>"; } } else { $msg = "<font color=red>enter name of album!</font>"; } if($msg=="") { //update query }
example.. consider example have name field includes email ids of user. if user want update mail id script executing if want make changes other field name, contact number, address how script need modify. if user want change mail id run , avoid , check mail id if exist. not other field. if want make changes other field surely have change name field first.
if want fire update query when $msg
sent, should use ($msg != '')
in if
statement.
Comments
Post a Comment