title: how to check if a table has been updated or inserted then wanted to do it, otherwise it in android
body: <p>i use volley library on android code
  i want to know check if my table has been updated or inserted then wanted to do it(A), otherwise it(B) 
  for example if my table updated or inserted then send (A)sms otherwise (B)toast </p>
  
  <p>its my activity code:</p>
  
  <pre><code>public class DeviceAddActivity extends AppCompatActivity implements View.OnClickListener {
  
  private static final String REGISTER_URL = "http://192.168.43.190/entezam/addphone.php";
  public static final String KEY_CUSTNAME = "Customer_non";
  public static final String KEY_PHONENAME = "Phone_Name";
  public static final String KEY_IMEI = "IMEI";
  private EditText editTextName;
  private EditText editTextPhoneName;
  private EditText editTextIMEI;
  private Button buttonRegister;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_device_add);
  
      editTextName = (EditText) findViewById(R.id.editTextcustname);
      editTextPhoneName = (EditText) findViewById(R.id.editTextphonename);
      editTextIMEI= (EditText) findViewById(R.id.editTextimei);
  
      buttonRegister = (Button) findViewById(R.id.buttonRegister);
  
      buttonRegister.setOnClickListener(this);
  }
  
  private void registerUser(){
      final String Customer_non = editTextName.getText().toString().trim();
      final String Phone_Name = editTextPhoneName.getText().toString().trim();
      final String IMEI = editTextIMEI.getText().toString().trim();
  
      StringRequest stringRequest = new StringRequest(Request.Method.POST, REGISTER_URL,
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      Toast.makeText(DeviceAddActivity.this,response,Toast.LENGTH_LONG).show();
                  }
              },
              new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                      Toast.makeText(DeviceAddActivity.this,error.toString(),Toast.LENGTH_LONG).show();
                  }
              }){
          @Override
          protected Map&lt;String,String&gt; getParams(){
              Map&lt;String,String&gt; params = new HashMap&lt;String, String&gt;();
              params.put(KEY_CUSTNAME,Customer_non);
              params.put(KEY_PHONENAME,Phone_Name);
              params.put(KEY_IMEI,IMEI);
              return params;
          }
  
      };
  
      RequestQueue requestQueue = Volley.newRequestQueue(this);
      requestQueue.add(stringRequest);
  }
  
  @Override
  public void onClick(View v) {
      if(v == buttonRegister){
          registerUser();
      }
  }
  </code></pre>
  
  <p>and its my php code:</p>
  
  <pre><code>&lt;?php
  
  if($_SERVER['REQUEST_METHOD']=='POST'){
      $Phone_Name = $_POST['Phone_Name'];
      $Customer = $_POST['Customer_non'];
      $IMEI = $_POST['IMEI'];
      require_once('dbConnect.php');
      $sql = "INSERT INTO phone_in (Phone_Name,Customer_non,IMEI) VALUES ('$Phone_Name','$Customer','$IMEI')";
      if(mysqli_query($con,$sql)){
          echo "Successfully Registered";
      }else{
          echo "Could not register";
      }
  }else{echo 'error';}
  </code></pre>