When I clicked the submit button it shows text "Data inserted successfully but when I checked phpmyadmin there is no entry of Data .......
try { ArrayList nam = new ArrayList(3);
String UserID = uid.getText().toString();
String Password = fn.getText().toString();
String Name = ln.getText().toString();
nam.add(new BasicNameValuePair("UserID", UserID));
nam.add(new BasicNameValuePair("Password", Password));
nam.add(new BasicNameValuePair("Name", Name));
HttpClient httpclient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("http://10.14.48.56:4196/androidDb/androidtest.php");
httpPost.setEntity(new UrlEncodedFormEntity(nam));
HttpResponse response = httpclient.execute(httpPost);
txt.setText("Data Inserted Successfully");
fn.setText("");
ln.setText("");
}catch(Exception e)
{
txt.setText(e.toString());
}
0 comments:
Post a Comment