Problem is coming in ajax response

Hello All,

I am using below code to make a user status visible or hide. It is working fine, value is changing in database.
The problem is coming in ajax response. In every case i am getting…“Unknown error occured, Please try later”

<?php
include_once("php_includes/check_login_status.php");
if($user_ok==FALSE)
{
header("location: http://www.buddiescolumn.com");
    exit();	
}
?>

 <?php
 $pro1="";
 if(isset($_POST['c2'])){
 $pro2=$_POST['c2'];
        $sql = "SELECT * FROM users WHERE username='shail' AND activated='1' LIMIT 1";
        $query=mysqli_query($db_conx,$sql);
		while($row = mysqli_fetch_array($query, MYSQLI_ASSOC)){
		$searchp1 = $row["searchopt"];}
 if($pro2==$searchp1)
 echo "error";

 else
 {
	$sql="UPDATE users SET searchopt='$pro2' WHERE username='shail' AND activated='1' LIMIT 1 ";
        $query=mysqli_query($db_conx,$sql);
	 if($query===TRUE)
	  echo "success";

 }}
 ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script src="js/main.js"></script>
<script src="js/ajax.js"></script>

<script>
function schange()
{
	var c = document.getElementsByName("search");
	var c2 = "";
	for(var i = 0; i < c.length; i++){
		if(c[i].checked == true){
			c2 = c[i].value;
		}
	}
	if(c2 == ""){
		_("status3").innerHTML = "Fill out all of the form data";
	}
	 else {
		_("serchbtn").style.display = "none";
		_("status3").innerHTML = 'please wait ...';
		var ajax = ajaxObj("POST", "eare.php");
        ajax.onreadystatechange = function() {
	        if(ajaxReturn(ajax) == true) {
	            if(ajax.responseText == "error"){
					_("status3").innerHTML = "Your preferred option is already set";
					_("serchbtn").style.display = "block";
				}		
			 else if(ajax.responseText == "Success")
				 {
                   _("status3").innerHTML = "Your Preferred Option is set successfully.";		
	        }
			else {_("status3").innerHTML = "Unknown error occured, Please try later";
			_("serchbtn").style.display = "block";	}
        }}
        ajax.send("c2="+c2);
	}

}

</script>
</head>

<body>
       <strong>Set Search option</strong>
      <form onsubmit="return false;">
      <input type="radio" value="0" id ="search" name="search">Set to searchable<br/>
      <input type="radio" value="1" id ="search" name="search">Set to hidden<br/>
       <button id="serchbtn" onclick="schange()">Update</button>
       <p id="status3"></p>
</body>
</html>

3 words

line26
line61
Case

Hi, got the meaning of line26 and line61. but case?

if case is for case sensitivity then i have changed that, but same message

then obviously your response text is neither “error” nor “Success” (maybe a casing problem on the server side?)