Can't get it to delete

After the script moves the info into the new database it does not delete the row.

// Username from link

// Retrieve data from table where row that match this passkey
$sql1=“SELECT * FROM $tbl_name1 WHERE confirm_code =’$passkey’”;

// If successfully queried

// Count how many row has this passkey

// if found this passkey in our database, retrieve data from table “temp_members_db”

if(!$_POST[“password1”] || !$_POST[“password2”]){
$error=“Please fill the required fields”;
}else if(empty($username)){
$error=“No Confirmation Link Sent”;
}else if($_POST[“password1”] != $_POST[“password2”]){
$error=“PASSWORDS do not match!”;
//validate password length
}else if(strlen($_POST[“password1”]) < 6){
$error=“PASSWORD is too short! Must be 6 characters long”;
// it is acceptable, so hash it
$encrypt_password=“Some Hashing”;

	// Insert data into database 
	$sql2="UPDATE user SET password = '$encrypt_password' WHERE username = '$username'";
	// if suceesfully inserted data into database, send confirmation link to email 
		$status="Your Password Has Been Reset";
                     // Delete information of this user from table "temp_members_db" that has this passkey 
                    $sql3="DELETE FROM $tbl_name1 WHERE confirm_code = '$confirm_code'";


Make sure you are reporting errors. e.g.

[php]$result3=mysql_query($sql3)or die(mysql_error());[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service