title: if/else trouble onPostExecute on a RegisterActivity
body: <p>I am just new in programming world with no experience. I am about to finish my Android project but my problem is: My toast message always says Success even if I entered the exists phone no from my application. Please help me with the correct code!! (i am doing this for a long time) and the query is executed right function but the message is not shown properly.</p>
  
  <pre><code>//java
  public class SignupActivity extends AsyncTask&lt;String, Void, String&gt; {
  
      private Context context;
  
      public SignupActivity(Context context) {
          this.context = context;
      }
  
      protected void onPreExecute() {
  
      }
  
      @Override
      protected String doInBackground(String... arg0) {
          String fullName = arg0[0];
        //  String userName = arg0[1];
          String passWord = arg0[1];
          String phoneNumber = arg0[2];
          String emailAddress = arg0[3];
  
          String link;
          String data;
          BufferedReader bufferedReader;
          String result;
  
          try {
              data = "?fullname=" + URLEncoder.encode(fullName, "UTF-8");
          //    data += "&amp;username=" + URLEncoder.encode(userName, "UTF-8");
              data += "&amp;password=" + URLEncoder.encode(passWord, "UTF-8");
              data += "&amp;phonenumber=" + URLEncoder.encode(phoneNumber, "UTF-8");
              data += "&amp;emailaddress=" + URLEncoder.encode(emailAddress, "UTF-8");
  
          link = "http://mangoair.in/MangoAir_User/mangoair_reg/tryrr.php" + data;
  
              //   link = "http://hostogen.com/mangoair10/tryrr.php" + data;
  
              URL url = new URL(link);
              HttpURLConnection con = (HttpURLConnection) url.openConnection();
  
              bufferedReader = new BufferedReader(new InputStreamReader(con.getInputStream()));
              result = bufferedReader.readLine();
              return result;
          } catch (Exception e) {
             // return new String("Exception: " + e.getMessage());
              return null;
          }
      }
  @Override
      protected void onPostExecute(String result) {
  
  String jsonStr = result;
  
   if (jsonStr != null) {
              try {
                  JSONObject jsonObj = new JSONObject(jsonStr);
                  String query_result = jsonObj.getString("query_result");
                  if (query_result.equals("SUCCESS")) {
                      Toast.makeText(context, "Data inserted successfully. Signup successfully.", Toast.LENGTH_LONG).show();
  
                  }
  
                   else if (query_result.equals("FAILURE")) {
                      Toast.makeText(context, "Data could not be inserted. Signup failed.", Toast.LENGTH_SHORT).show();
                  }
                  else{
                      Toast.makeText(context, "Couldn't connect to remote database.", Toast.LENGTH_SHORT).show();
                  }
              } catch (JSONException e) {
                  e.printStackTrace();
                 // Toast.makeText(context, "Error parsing JSON Please data Fill all the records.", Toast.LENGTH_SHORT).show();
                 // Toast.makeText(context, "Please LogIn", Toast.LENGTH_SHORT).show();
                  Toast.makeText(context, "Please Login", Toast.LENGTH_SHORT).show();
  
              }
          } else {
              Toast.makeText(context, "Couldn't get any JSON data.", Toast.LENGTH_SHORT).show();
          } 
  </code></pre>