0, 'message' => "Feilds are Empty. Kindly Check.", ); array_push($data,$arr); } else { $username = addslashes($_POST['username']); $email = addslashes($_POST['email']); $servername51 = "203.115.101.51"; $username51 = "ashutosh"; $password51 = "ashutosh@#888"; $dbname51 = "matrix"; // Connect to DB $mysqlimatrix51 = new mysqli($servername51, $username51, $password51, $dbname51); // Check connection if ($mysqlimatrix51->connect_error) { die("Connection failed: " . $mysqlimatrix51->connect_error); } // Prepare the statement $query = "SELECT id FROM auth_emails WHERE email = ? AND username = ? AND status = 1 LIMIT 1"; $stmt = $mysqlimatrix51->prepare($query); if (!$stmt) { die("Prepare failed: " . $mysqlimatrix51->error); } // Bind parameters $stmt->bind_param("ss", $email, $username); // Execute $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows > 0) { http_response_code(200); // OK $arr=array ( 'status' => true ); array_push($data,$arr); } else { http_response_code(401); // Not Found $arr=array ( 'status' => false ); array_push($data,$arr); } $stmt->close(); $mysqlimatrix51->close(); } echo json_encode($data); } ?>