Sunday, September 4, 2011

[android-developers] Re: Date Problem with mySQL

If i hard code the value like this.

nameValuePairs.add(new BasicNameValuePair("Date", "2001-09-04"));

it works.


Musaddaq

On Sep 4, 8:44 pm, Atif Musaddaq <atif.musad...@gmail.com> wrote:
> Hi, All
>
> Facing small problem in my Android App. I am getting 4 values from the user
> including current date which user can change. Date format is YYYY-MM-DD
>
> <<Code>>
> // this is for Date to be displayed
> private void updateDate() {
>     mDateDisplay.setText(
>         new StringBuilder()
>                 // Month is 0 based so add 1
>         .append(mYear).append("-")
>                 .append(mMonth + 1).append("-")
>                 .append(mDay)
>                 );
>     date=mDateDisplay.getText().toString();
>     Log.i("Date",date);
>
> }
>
> It is displaying the right date and also updating it on Mobile
> device/emulator.
>
> Now i have list of 4 pairs which i am sending with URL to the PHP Server
>
> List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(4);
> .....
> nameValuePairs.add(new BasicNameValuePair("Date", "date"));
> ......
>
> *It is sending all other 3 values to my "mySQL" database but not the DATE. I
> also changed the Format of the Date but no success.*
> *
> *
> *Any help please*
>
> --
> Musaddaq

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment