To upload Registration data from Android To PHP server
<p>My PHP code is as follow</p>

<pre><code>         &lt;?php
         error_reporting(~E_NOTICE);
         //include('db.php');

        if($_GET['fname'])
           {
           $fname=$_GET['fname'];
           //echo $fname.'gytgy';
                 }
           if($_GET['lname'])
            {
          $lname=$_GET['lname'];
             //echo $lname.'vbvcbcvb';
            }
           if($_GET['email'])
          {
            $email=$_GET['email'];
           //echo $email.'fgfdgdf';
              }
          $conn=mysql_connect("localhost","MyserverDatabase username","MyserverDatabase password");
         if(!$conn)
              {
                die("could not connect". mysql_error());
                  }
             mysql_select_db("MyserverDatabase username",$conn);


          //$name =$_POST['name'];
         $query="insert into android
           (fname,lname,email)values('".$fname."','".$lname."','".$email."')";

          $query1=mysql_query($query);
            if ($query1="")
         {echo "unsuccessfull";
              }
              else
            {
         echo"successfull";
            }
               ?&gt;
</code></pre>

<p>My android Java Code is As follow</p>

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

EditText fname;
EditText lname;
EditText email;
InputStream is;
TextView text;
List&lt;NameValuePair&gt; nameValuePairs;
byte[] data;
StringBuffer buffer;
public static int a = 0;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    fname = (EditText)findViewById(R.id.name1);
    lname = (EditText)findViewById(R.id.name2);
    email = (EditText)findViewById(R.id.emailname);
    text= (TextView)findViewById(R.id.text);
    Button register = (Button) findViewById(R.id.register);
    register.setOnClickListener(new OnClickListener() 
    {
        public void onClick(View v) 
        {   
            if(fname.getText().length()== 0)
            {
                text.setText("Enter firstname");
            }
            else if(lname.getText().length()== 0)
            {
                text.setText("Enter Lastname");
            }
            else if(email.getText().length()== 0)
            {
                text.setText("Enter Email Id");
            }
            else{
                try{
                String a = fname.getText().toString().trim();
                String b = lname.getText().toString().trim();
                String c = email.getText().toString().trim();
                HttpClient httpclient = new DefaultHttpClient();
                HttpPost httppost = new
                HttpPost("http://android/android_user.php");
                nameValuePairs = new ArrayList&lt;NameValuePair&gt;(3);
                nameValuePairs.add(new BasicNameValuePair("fname", "parth"));
                nameValuePairs.add(new BasicNameValuePair("lname", "da"));
                nameValuePairs.add(new BasicNameValuePair("email", "asd"));
                httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs,HTTP.UTF_16));


                HttpResponse response = httpclient.execute(httppost);
                HttpEntity entity = response.getEntity();
                is = entity.getContent();
                fname.setText("");
                lname.setText("");
                email.setText("");
                text.setText("");
                }catch(Exception e){
                Log.e("log_tag", "Error in http connection "+e.toString());
                text.setText("Connection error");
                }
            }
        }
    });
 }
 }    
     //Also my Manifest I have Included Permission for Internet.
</code></pre>

<p>My code is not working @ when i enter my data on My emulator my data does not goes into my server database instead of that some blank data goes into database Can anyone please help me how can I do the same.Also Please point out what is the mistake in My code. </p>
