title: Activity doesn't save info into MySQL Database
body: <p>I have one reservation form which must save information to <code>MySQL</code> database. On first Axtivity user fill the form then whit intent I save the information and passit to second activity where is the button save. When I click button save nothing goes to database.
  This is activity 1</p>
  
  <pre><code>static String Name;
  static String Email;
  static String Phone;
  static String Comment;
  static String DateTime;
  static String numberOfPeople;
  
  private EditText editText1, editText3, editText2, editText4, datePicker, editText5; //, txtTime;
  private Button btnMenues, btnTimePicker, btnCalendar;
  CustomDateTimePicker custom;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.reservation);
      custom = new CustomDateTimePicker(this,
              new CustomDateTimePicker.ICustomDateTimeListener() {
  
                  @Override
                  public void onSet(Dialog dialog, Calendar calendarSelected,
                          Date dateSelected, int year, String monthFullName,
                          String monthShortName, int monthNumber, int date,
                          String weekDayFullName, String weekDayShortName,
                          int hour24, int hour12, int min, int sec,
                          String AM_PM) {
                      ((EditText) findViewById(R.id.datePicker)).setText(calendarSelected.get(Calendar.DAY_OF_MONTH)
                                      + "/" + (monthNumber+1) + "/" + year
                                      + ", " + hour12 + ":" + min
                                      + " " + AM_PM);
                  }
  
                  @Override
                  public void onCancel() {
  
                  }
              });
      /**
       * Pass Directly current time format it will return AM and PM if you set
       * false
       */
      custom.set24HourFormat(false);
      /**
       * Pass Directly current data and time to show when it pop up
       */
      custom.setDate(Calendar.getInstance());
  
      findViewById(R.id.btnCalendar).setOnClickListener(
              new OnClickListener() {
  
                  @Override
                  public void onClick(View v) {
                      custom.showDialog();
                  }
  });           
  
      editText1 = (EditText) findViewById(R.id.personName);
      editText3 = (EditText) findViewById(R.id.personPhone);
      editText2 = (EditText) findViewById(R.id.personEmail);
      editText4 = (EditText) findViewById(R.id.personComment);
      datePicker = (EditText) findViewById(R.id.datePicker);
      editText5 = (EditText) findViewById(R.id.editText5);
  
      btnCalendar = (Button) findViewById(R.id.btnCalendar);
      btnMenues = (Button) findViewById(R.id.continueWithReservation);
  
      btnMenues.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
              Intent intent = new Intent(Reservation.this, ReservationSecond.class);
              String Name = editText1.getText().toString();
              String Email = editText2.getText().toString();
              String Phone = editText3.getText().toString();
              String Comment = editText4.getText().toString();
              String DateTime = datePicker.getText().toString();
              String numberOfPeople = editText5.getText().toString();
  
              intent.putExtra("Name", Name);
              intent.putExtra("Email", Email);
              intent.putExtra("Phone", Phone);
              intent.putExtra("Comment", Comment);
              intent.putExtra("DateTime", DateTime);
              intent.putExtra("numberOfPeople", numberOfPeople);
  
              startActivity(intent);
          }
      }); 
  }
  </code></pre>
  
  <p>This is Activity 2</p>
  
  <pre><code>String getName;
  String getEmail;
  String getPhone;
  String getComment;
  String getDateTime;
  String getnumberOfPeople;
  
  private Button btnMenues;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.reservation_second);
  
      btnMenues = (Button) findViewById(R.id.finish);
  
      btnMenues.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Bundle extras = getIntent().getExtras();
              if (extras != null) {
                  getName = extras.getString("Name");
                  getEmail = extras.getString("Email");
                  getPhone = extras.getString("Phone");
                  getComment = extras.getString("Comment");
                  getDateTime = extras.getString("DateTime");
                  getnumberOfPeople = extras.getString("numberOfPeople");
                  Log.e("err", getName + " " + getEmail + " " + getPhone + " " + getComment + " " + getDateTime + " " + getnumberOfPeople );
              }   
  
              new SummaryAsyncTask().execute((Void) null);
  
              startActivity(getIntent());
          }
      }); 
  }
  
  class SummaryAsyncTask extends AsyncTask&lt;Void, Void, Boolean&gt; {
  
      private void postData(String getNameToData, String getEmailData, String getPhoneData,
              String getCommentData, String getDateTimeData, String getnumberOfPeopleData) {
  
          HttpClient httpclient = new DefaultHttpClient();
          HttpPost httppost = new HttpPost("http://link.to.site/saveReservation.php");
  
          try {
              ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(4);
              nameValuePairs.add(new BasicNameValuePair("Name", getNameToData));
              nameValuePairs.add(new BasicNameValuePair("Email", getEmailData));
              nameValuePairs.add(new BasicNameValuePair("Phone", getPhoneData));
              nameValuePairs.add(new BasicNameValuePair("Comment", getCommentData));
              nameValuePairs.add(new BasicNameValuePair("DateTime", getDateTimeData));
              nameValuePairs.add(new BasicNameValuePair("numberOfPeople", getnumberOfPeopleData));
              httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
              HttpResponse response = httpclient.execute(httppost);
          }
          catch(Exception e)
          {
              Log.e("log_tag", "Error:  "+e.toString());
          }
      }
  
      @Override
      protected Boolean doInBackground(Void... params) {
          postData(getName, getEmail, getPhone, getComment, getDateTime, getnumberOfPeople );
          return null;
      }
  
  }
  </code></pre>
  
  <p>I've put in second activity in intent part log to check <code>Log.e("err", getName + " " + getEmail + " " + getPhone + " " + getComment + " " + getDateTime + " " + getnumberOfPeople );</code> and in <code>LogCat</code> I see this error when button for save into DB is clicked</p>
  
  <pre><code>11-08 17:04:44.654: E/err(1112): Test Test@myEmail.com 33733721 Hello 26/11/2014, 4:50 PM 3
  </code></pre>
  
  <p>This is xml for the first activity</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" &gt;
  
          &lt;EditText
              android:id="@+id/personName"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="10dp"
              android:ems="10"
              android:hint="@string/NameForReservation"
              android:inputType="textPersonName"
              android:maxLength="25" /&gt;     
  
          &lt;EditText
              android:id="@+id/personPhone"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="10dp"
              android:ems="10"
              android:hint="@string/ContactPhone"
              android:inputType="phone"
              android:maxLength="16" /&gt;
  
          &lt;EditText
              android:id="@+id/personEmail"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="10dp"
              android:ems="10"
              android:hint="@string/CustomerEmailContact"
              android:inputType="textEmailAddress"
              android:maxLength="50" /&gt;
  
          &lt;EditText
              android:id="@+id/personComment"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="10dp"
              android:ems="10"
              android:hint="@string/CustomerCommentar"
              android:maxLength="100" /&gt;
  
  
      &lt;LinearLayout 
        android:layout_width="match_parent"
      android:layout_height="wrap_content" 
      android:id="@+id/linearLayout1" &gt;
      &lt;Button 
          android:layout_height="wrap_content"
          android:layout_weight="0" 
          android:id="@+id/btnCalendar" 
          android:text="@string/ReservationDate"
          android:layout_width="100dp" /&gt;
          &lt;requestFocus&gt;&lt;/requestFocus&gt;
      &lt;EditText
          android:id="@+id/datePicker"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_weight="0.27"
          android:inputType="datetime" /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout 
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;TextView
          android:id="@+id/numberOfPeople"
          android:layout_width="190dp"
          android:layout_height="36dp"
          android:layout_weight="0.04"
          android:layout_marginLeft="10dp"
          android:text="@string/numberOfPeople" /&gt;       
          &lt;requestFocus&gt;&lt;/requestFocus&gt;
  
      &lt;EditText
          android:id="@+id/editText5"
          android:layout_width="10dp"
          android:layout_height="41dp"
          android:layout_weight="0.02"
          android:ems="10"
          android:inputType="number"
          android:maxLength="2"
          android:text="" /&gt;
  
  &lt;/LinearLayout&gt;
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  &lt;Button
      android:id="@+id/continueWithReservation"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="right"
      android:gravity="center"
      android:text="@string/reservationContinue" /&gt;
  &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Any idea what I miss here?</p>
  
  <p>UPDATE <code>php</code> file from server side</p>
  
  <pre><code>&lt;?php
  $icon = mysql_connect("localhost","user","pass");
  if(!$icon)
  {
      die('Could not connect : ' . mysql_erroe());
  }
  mysql_select_db("db", $icon)or die("database selection error");
  echo json_encode($data);
  
  $Name=$_POST['Name'];
  $Phone=$_POST['Phone'];
  $Email=$_POST['Email'];
  $Comment=$_POST['Comment'];
  $DateTime=$_POST['DateTime'];
  $numberOfPeople=$_POST['numberOfPeople'];
  date_default_timezone_set("Europe/Bucharest"); // time zone
      $DateTime= date("Y-m-d H:i:s");
  
  mysql_query("INSERT INTO reservation (Name, Phone, Email, Comment, DateTime, numberOfPeople)
           VALUES ('$Name', '$Phone', '$Email', '$Comment', '$DateTime', '$numberOfPeople')",$icon);
  mysql_close($icon);
  </code></pre>