trying to send data using POST from android to sql
<p>I am trying to POST data from my android to my sql server</p>

<p>This is in my android application </p>

<pre><code>List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
nameValuePairs.add(new BasicNameValuePair("firstName",value));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
</code></pre>

<p>This is my php</p>

<pre><code>$firstName = $_POST["firstName"];

$sql = "SELECT firstName FROM `colleague` WHERE `lastName` 
   LIKE '%$firstName%' LIMIT 0, 5 ";
$result = mysql_query($sql);

while($row = mysql_fetch_array($result)) $output[] = $row['firstName'];

echo implode("&lt;br/&gt;",$output);
print(json_encode($output));
</code></pre>

<p>But this now selects the first five rows .. it does not receive anything in $firstName = $_POST["firstName"]; ??</p>

<p>php Notice</p>

<pre><code>Undefined index: firstName in C:\xampp\htdocs\
</code></pre>

<p>http declaration</p>

<pre><code>HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://192.168.1.1/Search.php");
</code></pre>
