0

我正在尝试使用 PHP 和 JSON 从 MYSQL 中检索对象。该对象是从应用程序中选择的,然后应该是可编辑的。但是我在 logcat 中收到“No value for ...”错误,如下所示:

W/System.err(21945): org.json.JSONException: No value for product

在阅读了关于 SO 的一些问答之后,我认为这些行有问题,你们能看出它有什么问题吗?

JSONObject json = jsonParser.makeHttpRequest(
url_product_details, "GET", params1);

Log.d("Single Product Details", json.toString());

// JSON success tag
success = json.getInt(TAG_SUCCESS);
if (success == 1) {
// Successfully received product details
JSONArray productObj = json.getJSONArray(TAG_PRODUCT); // JSON array

// Get first product object from JSON Array
final JSONObject product = productObj.getJSONObject(0);

谢谢!

4

0 回答 0