无法从edittext获取文本并将其发送到数据库。我能够成功上传图片,但不能使用edittext。
SQL代码:
$gambar_g=$_POST['gambar_g'];
$deskripsi_g = $_POST['deskripsi_g'];
我正在使用sql INSERT INTO语句,这是我的android代码:
public static final String KEY_IMAGE = "gambar_g";
public static final String KEY_TEXT = "deskripsi_g";
ivImage = (ImageView) findViewById(R.id.ivImage);
des = (EditText) findViewById(R.id.desimg);
ivGallery.setOnClickListener(this);
ivUpload.setOnClickListener(this);
desk = des.getText().toString();
课程在后台做:
@Override
protected String doInBackground(Void... params) {
RequestHandler rh = new RequestHandler();
HashMap<String,String> param = new HashMap<String,String>();
param.put(KEY_TEXT, desk);
param.put(KEY_ID_LW, sid_lw);
param.put(KEY_ID_F, id_f);
param.put(KEY_IMAGE, image);
String result = rh.sendPostRequest(UPLOAD_URL, param);
return result;
}