title: i am trying to upload my data on sql server through my android app
body: <p>here is the android code</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
   String ServerURL = "http://portal15.unaux.com/get_data.php";
  
   EditText qr_code, desc,price ;
  
   Button button;
  
   String Tempqr, Tempdesc,Tempprice ;
  
  
    @Override
  
    protected void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.activity_main);
  
   qr_code=(EditText) findViewById(R.id.code);
  
   desc=(EditText) findViewById(R.id.resource);
  
   price=(EditText) findViewById(R.id.price);
  
   button=(Button) findViewById(R.id.button);
   button.setOnClickListener(new View.OnClickListener() {
       @Override
       public void onClick(View view) {
           Getdata();
           insertdata(Tempqr,Tempdesc,Tempprice);
       }
      // converting input data to string
      public void Getdata(){
  
          Tempqr = qr_code.getText().toString();
          Tempdesc=desc.getText().toString();
          Tempprice = price.getText().toString();
  
      }
  
       public void insertdata(final String code, final String description,final String price){
  
           class SendPostReqAsyncTask extends AsyncTask&lt;String, Void, String&gt; {
               @Override
               protected String doInBackground(String... params) {
  
                   String qrHolder = code;
                   String descHolder = description ;
                   String priceHolder=price;
  
                   List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
  
                   nameValuePairs.add(new BasicNameValuePair("code", qrHolder));
                   nameValuePairs.add(new BasicNameValuePair("description", descHolder));
                   nameValuePairs.add(new BasicNameValuePair("price", priceHolder));
                   try {
                       HttpClient httpClient = new DefaultHttpClient();
  
                       HttpPost httpPost = new HttpPost(ServerURL);
  
                       httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  
                       HttpResponse httpResponse = httpClient.execute(httpPost);
  
                       HttpEntity httpEntity = httpResponse.getEntity();
  
  
                   } catch (ClientProtocolException e) {
  
                   } catch (IOException e) {
  
                   }
                   return "Data Inserted Successfully";
               }
  
               @Override
               protected void onPostExecute(String result) {
  
                   super.onPostExecute(result);
  
                   Toast.makeText(MainActivity.this, "Data Submit Successfully", Toast.LENGTH_SHORT).show();
  
               }
           }
  
           SendPostReqAsyncTask sendPostReqAsyncTask = new SendPostReqAsyncTask();
  
           sendPostReqAsyncTask.execute(code,description,price);
       }
   });
   }
  
  }
  </code></pre>
  
  <p>Data is not uploading in mysql database but a toast is displaying on my phone saying data uploaded successfully but no data is uploaded on server. </p>
  
  <p>Here is my PHP Code </p>
  
  <pre><code>&lt;?php include 'DatabaseConfig.php'; 
  $con = mysqli_connect($HostName,$HostUser,$HostPass,$DatabaseName); 
  $code = $_POST['code']; 
  $details = $_POST['description']; 
  $price=$_POST['price']; 
  $Sql_Query="INSERT INTO item_details (item_code, item_details, Item_price) 
  VALUES(' $code ',' $details ',' $price')"; 
  if(mysqli_query($con,$Sql_Query)) { 
      echo 'Data Submitted Successfully'; 
  } 
  else { 
      echo 'Try Again'; 
  } 
  mysqli_close($con); ?&gt;
  </code></pre>