More than one value is received but when I am parsing the JSON into Android, it is only showing the first value.

Here is the JsonNew.php file:

```
require "index.php";
$user_shopID = $_POST["UniqueKey"] ;
$sql_query="Select * from products where ShopID like '$user_shopID';";
$result = mysqli_query($con, $sql_query);
$response = array();
while ($row = mysqli_fetch_array($result))
{
    array_push($response,array("ProductID"=>$row[0],"Product Name"=>$row[1], "Buying Price"=>$row[3], "Selling Price"=>$row[4]));
}

echo json_encode(array("server_response"=>$response));
mysqli_close($con);

```

This is the ContactAdapters.java:

```
public class ContactAdapter extends ArrayAdapter {

    List list = new ArrayList();

    public ContactAdapter(@NonNull Context context, @LayoutRes int resource) {
        super(context, resource);
    }

    public void add(Contacts object) {
        super.add(object);
        list.add(object);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Nullable
    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
        View row;
        row = convertView;
        ContactHolder contactHolder;

        if (row == null) {
            LayoutInflater layoutInflater = (LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            row = layoutInflater.inflate(R.layout.row_layout, parent, false);
            contactHolder = new ContactHolder();
            contactHolder.tx_id = (TextView) row.findViewById(R.id.id);
            contactHolder.tx_name = (TextView) row.findViewById(R.id.name);
            contactHolder.tx_buy = (TextView) row.findViewById(R.id.buy);
            contactHolder.tx_sell = (TextView) row.findViewById(R.id.sell);
            row.setTag(contactHolder);
        } else {
            contactHolder = (ContactHolder) row.getTag();
        }

        Contacts contacts = (Contacts) this.getItem(position);
        contactHolder.tx_id.setText(contacts.getId());
        contactHolder.tx_name.setText(contacts.getName());
        contactHolder.tx_buy.setText(contacts.getBuy());
        contactHolder.tx_sell.setText(contacts.getSell());
        return row;
    }

    static class ContactHolder {
        TextView tx_id, tx_name, tx_buy, tx_sell;
    }
}

```

And this the row\_layout.xml 

```
android:layout_width="match_parent"
android:layout_height="75dp"
xmlns:app="http://schemas.android.com/apk/res-auto">

<TextView
    android:id="@+id/id"
    android:layout_width="100dp"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:text="TextView"
    android:gravity="center"
    android:textColor="#000000"
    android:layout_below="@+id/textView13" />

<TextView
    android:id="@+id/name"
    android:layout_width="120dp"
    android:layout_height="match_parent"
    android:layout_toRightOf="@+id/id"
    android:text="TextView"
    android:gravity="center"
    android:textColor="#000000"
    android:layout_below="@+id/textView14" />

<TextView
    android:id="@+id/buy"
    android:layout_width="100dp"
    android:layout_height="match_parent"
    android:text="TextView"
    android:gravity="center"
    android:textColor="#000000"
    android:layout_toRightOf="@+id/name"
    android:layout_toEndOf="@+id/name"
    android:layout_alignTop="@+id/name" />

<TextView
    android:id="@+id/sell"
    android:layout_width="100dp"
    android:layout_height="match_parent"
    android:layout_toRightOf="@+id/buy"
    android:text="TextView"
    android:gravity="center"
    android:textColor="#000000"
    android:layout_alignTop="@+id/buy"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />

```

Here is DisplayProductsListview.java

```
listview = (ListView) findViewById(R.id.listview);
    contactAdapter = new ContactAdapter(this,R.layout.row_layout);
    listview.setAdapter(contactAdapter);
    json_string = getIntent().getExtras().getString("json_data");
    try {
        jsonObject = new JSONObject(json_string);
        jsonArray = jsonObject.getJSONArray("server_response");
        int count=0;
        String id, name, buy, sell;

        while (count<jsonObject.length()){
            JSONObject JO = jsonArray.getJSONObject(count);
            id = JO.getString("ProductID");
            name = JO.getString("Product Name");
            buy = JO.getString("Buying Price");
            sell = JO.getString("Selling Price");

            Contacts contacts = new Contacts(id,name,buy,sell);
            contactAdapter.add(contacts);
            count++;

        }

    } catch (JSONException e) {
        e.printStackTrace();
    }

}

```

Here is the Contacts.java

```
private String id, name, buy, sell;

public Contacts(String id, String name, String buy, String sell){

    this.setId(id);
    this.setName(name);
    this.setBuy(buy);
    this.setSell(sell);

}

public String getId() {
    return id;
}

public void setId(String id) {
    this.id = id;
}

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

public String getBuy() {
    return buy;
}

public void setBuy(String buy) {
    this.buy = buy;
}

public String getSell() {
    return sell;
}

public void setSell(String sell) {
    this.sell = sell;
}

```

}

When I am getting the JSON datas from the server, they are coming perfectly, but when I am making them display in a list view those datas are not coming. Only the first data and his values are coming into the list view. 

Here are the Screenshots: 

[Here you will See what is actually happening with me](https://i.stack.imgur.com/XvEm9.png)