Jump to content

need help in my edit form page


pixeltrace

Recommended Posts

hi,

 

i have a edit form for my brand items

and one of the items that i may need some validation is

the brand name.

 

my problem is, i need a validation code for the brand name

wherein if the brandname was changed it will execute this validation

to check if there is already an existing brand name

but if the brandname was not changed it will not execute this validation code.

 

currently this the validation code that i am using

 $sql_brand_name_check = mysql_query("SELECT brand_name FROM engsoon_brands WHERE brand_name!='$brand_name' AND bid!='$bid'");
  $brand_name_check = mysql_num_rows($sql_brand_name_check);
	if($brand_name_check > 0){
		echo '<script language=javascript> alert("brand name already exist.<br>use a different brand name!");top.location = "brandsmngr.php?id=3&bid='.$bid.'";</script>';
		unset($brand_name);
		exit();

 

this one no matter i modify the brand name or not, its still prompting me the message.

hope you could help me fix this.

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/62168-need-help-in-my-edit-form-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.