get row by id from mysql using android id EditText value
<p>hello i followed android tutorial for android client server app that contain one button when clicked the app will contact with mysql database that contain this fields(id,name,database2,oracle_advance,network,operating_system,software_engneering,gpa,status) and retrieve the data that in these fields . now i want to upgrade this app with an EditText inorder to let app user to enter his id and click the button to retrieve his result only . so how to make this upgrade ?</p>

<p>myphp code is :`</p>

<pre><code>   &lt;?php
    $response = array();
    $result = mysql_query("SELECT * FROM student_results WHERE id = 09604") or
    die(mysql_error());                
    if (mysql_num_rows($result) &gt; 0) {
    $response["products"] = array();

    while ($row = mysql_fetch_array($result)) {
    $product = array();
    $product["id"] = $row["id"];
    $product["name"] = $row["name"];
    $product["database2"] = $row["database2"];
    $product["oracle_advance"] = $row["oracle_advance"];
    $product["network"] = $row["network"];
    $product["OS"] = $row["OS"];
    $product["software_engneering"] = $row["software_engneering"];
    $product["status"] = $row["status"];
    $product["gpa"] = $row["gpa"];
    array_push($response["products"], $product);
    }
    $response["success"] = 1;

    JSON response
    echo json_encode($response);
    } else {
    $response["success"] = 0;
    $response["message"] = "No products found";

    // echo no users JSON
    echo json_encode($response);
     }`
</code></pre>

<p>i have MainActivity,jsonPARISER and student.java classes :</p>

<p>1-MainActivity class :</p>

<pre><code>    public class MainActivity extends Activity{

Button btnViewResult;
EditText searchText;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    searchText = (EditText) findViewById(R.id.srchText);
    // Buttons
    btnViewResult = (Button) findViewById(R.id.viewresult);

    // view products click event
    btnViewResult.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
    Intent i = new 
            Intent(getApplicationContext(),AndroidJSONParsingActivity.class);
    startActivity(i);

        }
        }
    );
       }
       }
</code></pre>

<p>2-jsonPAIRSER CLASS:</p>

<pre><code>     public class JSONParser {

static InputStream is = null;
static JSONObject jObj = null;
static String json = "";

// constructor
public JSONParser() {

}

public JSONObject getJSONFromUrl(String url) {

    // Making HTTP request
    try {
        // defaultHttpClient
        DefaultHttpClient httpClient = new DefaultHttpClient();
        HttpPost httpPost = new HttpPost(url);
        HttpResponse httpResponse = httpClient.execute(httpPost);
        HttpEntity httpEntity = httpResponse.getEntity();
        is = httpEntity.getContent();           

    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    } catch (ClientProtocolException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    try {
        BufferedReader reader = new BufferedReader(new InputStreamReader(
                is, "iso-8859-1"), 8);
        StringBuilder sb = new StringBuilder();
        String line = null;
        while ((line = reader.readLine()) != null) {
            sb.append(line + "\n");
        }
        is.close();
        json = sb.toString();
    } catch (Exception e) {
        Log.e("Buffer Error", "Error converting result " + e.toString());
    }

    // try parse the string to a JSON object
    try {
        jObj = new JSONObject(json);
    } catch (JSONException e) {
        Log.e("JSON Parser", "Error parsing data " + e.toString());
    }

    // return JSON String
    return jObj;

}
        }
</code></pre>

<p>3- student class :</p>

<pre><code>    public class AndroidJSONParsingActivity extends ListActivity {

// url to make request
private static String url = "http://10.0.2.2:8080/Android/get_all_products.php";

// JSON Node names
private static final String TAG_PRODUCTS ="products";
private static final String TAG_ID = "id";
private static final String TAG_DATABASE2 = "database2";
private static final String TAG_ORACLE_ADVANCE = "oracle_advance";
private static final String TAG_NETWORK = "network";
private static final String TAG_OS = "OS";
private static final String TAG_SOFTWARE_ENGNEERING = "software_engneering";
private static final String TAG_STATUS = "status";
private static final String TAG_GPA = "gpa";

// contacts JSONArray
JSONArray products = null;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    EditText srchText = (EditText)findViewById(R.id.srchText);

    // Hashmap for ListView
    ArrayList&lt;HashMap&lt;String, String&gt;&gt; contactList = new       
            ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
    // Creating JSON Parser instance
    JSONParser jParser = new JSONParser();

    // getting JSON string from URL
    JSONObject json = jParser.getJSONFromUrl(url);

    try {
        // Getting Array of Contacts
        products = json.getJSONArray(TAG_PRODUCTS);

        // looping through All Contacts
        for(int i = 0; i &lt; products.length(); i++){
            JSONObject c = products.getJSONObject(i);

            // Storing each json item in variable
            String id = c.getString(TAG_ID);
            String database2 = c.getString(TAG_DATABASE2);
            String oracle_advance = c.getString(TAG_ORACLE_ADVANCE);
            String network = c.getString(TAG_NETWORK);
            String OS = c.getString(TAG_OS);

            // Phone number is agin JSON Object
            String software_engneering = 
                            c.getString(TAG_SOFTWARE_ENGNEERING);
            String gpa = c.getString(TAG_STATUS);
            String status = c.getString(TAG_GPA);

            // creating new HashMap
            HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;
            ();
            // adding each child node to HashMap key =&gt; value
            map.put(TAG_ID, id);
            map.put(TAG_DATABASE2, database2);
            map.put(TAG_ORACLE_ADVANCE, oracle_advance);
            map.put(TAG_NETWORK, network);
            map.put(TAG_OS, OS);
            map.put(TAG_SOFTWARE_ENGNEERING, software_engneering);
            map.put(TAG_STATUS, status);
            map.put(TAG_GPA, gpa);

            // adding HashList to ArrayList
            contactList.add(map);
        }
    } catch (JSONException e) {
        e.printStackTrace();
    }


    /**
     * Updating parsed JSON data into ListView
     * */
    ListAdapter adapter = new SimpleAdapter(this, contactList,
            R.layout.list_item,
            new String[] { TAG_ID, TAG_DATABASE2,  
            TAG_ORACLE_ADVANCE,TAG_NETWORK,TAG_OS,TAG_SOFTWARE_ENGNEERING,
            TAG_STATUS,TAG_GPA }, new  
            int[] {
        R.id.index, R.id.database2, R.id.orad,     
            R.id.network, R.id.OS, R.id.SE, R.id.status, R.id.gpa });

    setListAdapter(adapter);

    // selecting single ListView item
    ListView lv = getListView();

    // Launching new screen on Selecting Single ListItem
    lv.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                int position, long id) {
            // getting values from selected ListItem
            String index = ((TextView) 
                            view.findViewById(R.id.index)).getText().toString();
            String database2 = ((TextView) 
                            view.findViewById(R.id.database2)).getText().toString();
            String oracle_advance = ((TextView) 
                            view.findViewById(R.id.orad)).getText().toString();
            String network = ((TextView) 
                            view.findViewById(R.id.network)).getText().toString();
            String OS = ((TextView) 
                            view.findViewById(R.id.OS)).getText().toString();
            String software_engneering = ((TextView)
                            view.findViewById(R.id.SE)).getText().toString();                    
            String status = ((TextView) 
                            view.findViewById(R.id.status)).getText().toString();
            String gpa = ((TextView) 
            view.findViewById(R.id.gpa)).getText().toString();
            // Starting new intent
            Intent in = new Intent(getApplicationContext(),
                            SingleMenuItemActivity.class);      
            in.putExtra(TAG_ID, index);
            in.putExtra(TAG_DATABASE2, database2);
            in.putExtra(TAG_ORACLE_ADVANCE, oracle_advance);
            in.putExtra(TAG_NETWORK, network);
            in.putExtra(TAG_OS, OS);
            in.putExtra(TAG_SOFTWARE_ENGNEERING, software_engneering);
            in.putExtra(TAG_STATUS, status);
            in.putExtra(TAG_GPA, gpa);
            startActivity(in);

        }
    });



}

     } 
</code></pre>

<p>when i execute the program it  shows the result of 09604 , i want to show the result of $id </p>

<p>how to make this ?</p>
