Android Question mysql issue

apty

Active Member
Licensed User
Longtime User
i am trying to update mysql table but the query seems to be overwriting instead of updating. In main activity i have the following.

B4X:
Sub rbtAnswer_CheckedChange(Checked As Boolean)
  
    If Checked = True Then
        Dim rbt As RadioButton
        'countera=tl
        rbt = Sender
        If rbt.Tag = RightIndex.Get(Qnumber) Then
        countera=countera+1
            Msgbox("Correct", "Result")
          
            Msgbox(countera, "Result")
            btnNext_Click
        Else
            Msgbox("Wrong", "Result")
        End If
  
    End If
  
    countera2=countera
  
  
End Sub

i then pass this value to another activity and used it as below
B4X:
Dim newvalue As Object=main.countera2
ExecuteRemoteQuery("update value1 set value1='value1' + '"&newvalue&"'  WHERE uniquename ='myname'", Q_UPDATE2)

However, instead of updating, the query overwrites using the newvalue that i have passed. I just want it to add to the current value..What am i doing wrong?
 

DonManfred

Expert
Licensed User
Longtime User
asuming the given value is an int
I think it should be
B4X:
ExecuteRemoteQuery("update tablename set value1=value1+"&newvalue&"  WHERE uniquename ='myname'", Q_UPDATE2)
 
Upvote 0
Top