So, im new around here and not quite sure if this should go in the php or the sql seeing is how its a bit of both, but my questions pertains to why my perpare statment doesnt work. Onto the question. My first prepare statments for the select works as should. The result is returned properly. So if there is no entry in the table with the id_address that matches it correctly goes into the if statement and then the second prepare statement is exicuted properly and the data is entered into the table. the second time around when i know that the entry is in the table so it should skip the first if because there is data in the $result, and it is less than 5. it goes into the if statement and echos $update_attempt. the issue i cant seem to resolve is that the update prepare statment to update the entry in the table fails and I cant seem to figure out why.

Code:
$attack = true;
if($stmt = $mysqli->prepare("SELECT `login_attempts`, `id` FROM attempts WHERE `id_address`=? LIMIT 1")){
	$stmt->bind_param("s", $crypt_address); /* Bind parameters s - string, b - boolean, i - int, etc */
	$stmt->execute(); /* Execute it */
	$stmt->bind_result($result, $id); /* Bind results */
	$stmt->fetch(); /* Fetch the value */
	if(!$result){
	        $attack = false;
		$new_attempt = 1;
		if($new_stmt = $mysqli->prepare("INSERT INTO `attempts`(`login_attempts`, `id_address`) VALUES(?, ?)")){
		        $new_stmt->bind_param("is", $new_attempt, $crypt_address); /* Bind parameters s - string, b - boolean, i - int, etc */
			if(!$new_stmt->execute()){ /* Execute it */
				echo "FAIL";
			}
			$new_stmt->close(); /* Close statement */
		}		
	}
	if($result <= 5){
		$attack = false;
		$update_attempt = $result + 1;
		echo $update_attempt;
		if($update_stmt = $mysqli->prepare("UPDATE `attempts` SET `login_attempts`=? WHERE `id_address`=?")){
			$update_stmt->bind_param("is", $update_attempt, $crypt_address); /* Bind parameters s - string, b - boolean, i - int, etc */
			if(!$update_stmt->execute()){ /* Execute it */
				echo "FAIL";
			}
			$update_stmt->close(); /* Close statement */
		}
	}
	$stmt->close(); /* Close statement */
}
return $attack;