Issue with update

I am new to php and having an issue. I am using the code so when our software program becomes unregistered, it hits this script and changes the registration code from the actual number to ----removed-----. I got the program to work, however it put ----removed----- on all of the registration codes not just the one that was submitted. This code orginally came from our registration program and i am trying to modify it so it will unregister. I have // out some of the code that was used for registration.

/* datbase connectino */
	include_once "conn.php";
	$con=new connection();

/* geting values on request */

$sql_install="select * from ezy_installs where install_regcode='$install_regcode'";

				 $sql="select * from ezy_installs where 
					install_regcode='$install_regcode' and 
					$remove = '---Removed---';
						$sql_ins="update ezy_installs set 
//	} else {
//	$message="success";
//			}
			} else {
//	} else {
//		$message="failure";
//	}
	 if($message=="success") {
	 } else {

function xml_response($status_attribute, $message){
/////////// Generating xml file on xml result ///////////////////////
$result_value='<?xml version="1.0" encoding="UTF-8" ?>
	<status value="'.$status_attribute.'">'.$message.'</status>
	$myFile = "xml/transaction.xml";
	$fh = fopen($myFile, 'w+') or die("can't open file");
	$m = fwrite($fh,$testob);
	 xml_response($status_attribute, $message);
// } else {
	echo "Direct access of this file is not allowed.";

$sql_ins="update ezy_installs set install_regcode='$remove'";

You’re going to need a WHERE part in your SQL query to specify which regcode it should remove ;) Right now the MySQL engine is not restricted to certain rows and will indiscriminately change -all- regcodes to removed.

I was thinking that the select statement was narrowing down to that one transaction.
Thank you,

Sponsor our Newsletter | Privacy Policy | Terms of Service