问题
In my first activity have to develop login form(username,password and button) via soap calling..it is worked successfully.
In 2nd activity have to listview using xml parsing...it is also worked well.
In 3rd activity have to displayed detail description of particular order.(if i have to click the any order in 2nd activity means that order detail description is displayed in 3rd activity)...it is also worked good.also in this activity have one button(change order status)..if i have to click the button means it is go to 4th activity..
In 4th activity have to display one field spinner(status)...here the spinner value is updated via soap calling in 4th activity...but is worked below query means UPDATE xcart_orders set status = '"+Status+"',orderid = '"+Orderid+"' where orderid = '12'
...
but it is not worked for this query
UPDATE xcart_orders set status = '"+Status+"',orderid = '"+Orderid+"' where orderid = '"+Orderid+"'
...
so I wish to need to use above query and click the any order in 2nd activity means it is go to 3rd activity...now i have to click the change status order button means it is go to 4th activity..the fourth activity i have to change the status means that status is updated in that particular orderid..please how can i do develop this....please help me...how is manage the code here...
Refer my code here:SingleMenuItemActivity(SingleMenuItemActivity) http://pastie.org/4656261InsertionExample) http://pastie.org/4656262(update)
回答1:
You can't update like this because you are updating same value on which you are putting where condition.
Suppose you want to update orderid 12 to 13 then your query should like this
String orderid1 = 13;
String orderid2 = 12;
"UPDATE xcart_orders
set status
= '"+Status+"',orderid
= '"+Orderid1+"' where orderid
= '"+Orderid2+"'"
But in your case you are using same variable at both places, It will work if upcoming values exists in your database but there is no meaning for executing that query in that case.
If you still have any doubt revert back.
来源:https://stackoverflow.com/questions/12274839/dynamically-update-data-value-in-android