title: Value always return 0 where it should return number of row inserted
body: <p>I have two table, one is <code>Information</code> and the other is <code>WorkForce</code></p>
  
  <p><strong>Information</strong></p>
  
  <p><a href="https://i.stack.imgur.com/f3C5Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f3C5Z.png" alt="enter image description here"></a></p>
  
  <p><strong>WorkForce</strong></p>
  
  <p><a href="https://i.stack.imgur.com/saPhW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/saPhW.png" alt="enter image description here"></a></p>
  
  <p>The twf <code>column</code> in <strong>WorkForce</strong> is used to get the <code>id</code> of <strong>Information</strong>, which suppose return as 1, but it return value 0. If the <code>id</code> in <strong>Information is</strong> 5, <code>twf</code> should be 5 too.</p>
  
  <p>Firstly I use the <code>a</code> to represent the number of selected row and then add the parameter of <code>a</code> into <code>addWorkForce</code>. The <code>toast</code> always display 0 .</p>
  
  <pre><code>  a=addInformation(name,weather,date2,status,first1[1],last1[1]);
    Toast.makeText(getApplicationContext(),a+"",Toast.LENGTH_LONG).show();
    addWorkForce(Sub, NoP, NoH,a);
  </code></pre>
  
  <p><strong>addInformation function</strong></p>
  
  <pre><code>  public long addInformation( final String name, final String weather, final String date2, final String status, final String timeIn, final String timeOut)
      {
          class AddInfo extends AsyncTask&lt;String, Void, String&gt; {
              ProgressDialog loading;
  
              @Override
              protected void onPreExecute() {
                  super.onPreExecute();
                  loading = ProgressDialog.show(WorkDetailsTable.this, "Please Wait",null, true, true);
              }
  
              @Override
              protected void onPostExecute(String s) {
                  super.onPostExecute(s);
                  loading.dismiss();
                  Toast.makeText(getApplicationContext(),s,Toast.LENGTH_LONG).show();
              }
  
              @Override
              protected String doInBackground(String... params) {
  
                  HashMap&lt;String, String&gt; data = new HashMap&lt;String,String&gt;();
                  data.put(Config.KEY_USER_NAME,name);
                  data.put(Config.KEY_WEATHER,weather);
                  data.put(Config.KEY_DATE,date2);
                  data.put(Config.KEY_STATUS,status);
                  data.put(Config.KEY_TIMEIN,timeIn);
                  data.put(Config.KEY_TIMEOUT,timeOut);
                  RequestHandler rh=new RequestHandler();
                  String result = rh.sendPostRequest(Config.ADD_INFORMATION,data);
                  return  result;
              }
          }
  
           AddInfo ru = new AddInfo();
           ru.execute(name,weather,date2,status,timeIn,timeOut);
  
          return 0;
  
      }
  </code></pre>
  
  <p>Can someone help me to figure out the problem ?    </p>
  
  <p><strong>addInformation.php</strong></p>
  
  <pre><code>&lt;?php 
  
      if($_SERVER['REQUEST_METHOD']=='POST'){
  
          //Getting values
          $name = $_POST['name'];
          $weather = $_POST['weather'];
          $date = $_POST['date'];
                  $status = $_POST['status'];
                  $timeIn = $_POST['timeIn'];
                  $timeOut = $_POST['timeOut'];
  
          //Creating an sql query
          $sql = "INSERT INTO information(name, weather, date, status, time_in, time_out) VALUES ('$name','$weather','$date', '$status', '$timeIn', '$timeOut')";
  
          //Importing our db connection script
          require_once('dbConnect.php');
  
          //Executing query to database
          if(mysqli_query($con,$sql)){
              echo 'Information Added Successfully';
          }else{
              echo 'Could Not Add Information';
          }
  
          //Closing the database 
          mysqli_close($con);
      }
  ?&gt;
  </code></pre>
  
  <p>This is how I used the code to get the row inserted into sqlite and it works</p>
  
  <pre><code> a = ts.insertTimeSheet(name, weather, date2, status, first1[1], last1[1]);
  </code></pre>
  
  <p><strong>TimeSheet</strong></p>
  
  <pre><code> public long insertTimeSheet(String name, String weather, String date, String status, String TimeIn, String TimeOut) {
          database = dbHelper.getWritableDatabase();
          ContentValues values = new ContentValues();
          values.put(MyDatabaseHelper.Name, name);
          values.put(MyDatabaseHelper.Weather, weather);
          values.put(MyDatabaseHelper.Date, date);
          values.put(MyDatabaseHelper.Status, status);
          values.put(MyDatabaseHelper.TimeIn_Info, TimeIn);
          values.put(MyDatabaseHelper.TimeOut_Info, TimeOut);
          return database.insert(MyDatabaseHelper.TABLE_INFO, null, values); // if the id in Information is 5, twf display 5 too
  </code></pre>