title: How can I delete row from sql database where 2 different data equals to something?
body: <p>I have a textview when I click it it deletes one row from table if my user's id equals to id in table. But now I want to delete the row where two different data from user equals to data in a table.
  Here is my php code:</p>
  
  <pre><code>public function deleteUser($email, $name){
              $stmt = $this-&gt;con-&gt;prepare("DELETE FROM users WHERE email = ? AND name = ?");
              $stmt-&gt;bind_param("ss", $email, $name);
              if($stmt-&gt;execute())
                  return true; 
              return false; 
          }
  
  
  $app-&gt;delete('/deleteuser/{email}{name}', function(Request $request, Response $response, array $args){
      $email = $args['email'];
      $name = $args['name'];
      $db = new DbOperations; 
      $response_data = array();
      if($db-&gt;deleteUser($email, $name)){
          $response_data['error'] = false; 
          $response_data['message'] = 'User has been deleted';    
      }else{
          $response_data['error'] = true; 
          $response_data['message'] = 'Plase try again later';
      }
      $response-&gt;write(json_encode($response_data));
      return $response
      -&gt;withHeader('Content-type', 'application/json')
      -&gt;withStatus(200);
  });
  </code></pre>
  
  <p>I have already tested it by using postman and it works very well but when I implement this code into android it crashes. Here is my API class:</p>
  
  <pre><code>@DELETE("deleteuser/{email}{name}")
      Call&lt;DefaultResponse&gt; deleteUser(
              @Field("email") String email,
              @Field("name") String name
  
      );
  </code></pre>
  
  <p>And this is the activity where I delete user:</p>
  
  <pre><code>User user = SharedPrefManager.getInstance(MySettingsActivity.this).getUser();
  
                          Call&lt;DefaultResponse&gt; call = RetrofitClient.getInstance().getApi().deleteUser(user.getEmail(),user.getName());
                          call.enqueue(new Callback&lt;DefaultResponse&gt;() {
                              @Override
                              public void onResponse(Call&lt;DefaultResponse&gt; call, Response&lt;DefaultResponse&gt; response) {
  
                                  if (!response.body().isErr()){
  
  //                                    SharedPrefManager.getInstance(MySettingsActivity.this).clear();
  //                                    Intent deleteIntent = new Intent(MySettingsActivity.this, WelcomeActivity.class);
  //                                    deleteIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
  //                                    startActivity(deleteIntent);
                                  }
                                  Toast.makeText(MySettingsActivity.this, response.body().getMsg(), Toast.LENGTH_SHORT).show();
                              }
  
                              @Override
                              public void onFailure(Call&lt;DefaultResponse&gt; call, Throwable t) {
  
                              }
                          });
  </code></pre>
  
  <p>When I deleted the user only by one data for example id it worked normally but when I want to delete it by two data it crashes? Please help me where I have a mistkake?</p>