Android Question ExecuteRemoteQuery to Update Table

Puthut Wibowo

Member
Licensed User
Hello, all
I am trying to make an Update Table from MYSQL in accordance with "Connect Android to MySQL Database Tutorial". MYSQL Syntax for Updates

B4X:
ExecuteRemoteQuery(("UPDATE tbl_assesment_kecanggihan SET idtingkatkecanggihan=?, skor=? Where id_assesment_kecanggihan=?, VALUES ('" & IdCanggih & "' ,'" & SpinPenilaian.SelectedItem & "' ,'" & IDAssCanggih &"'"), UpdateAssCanggih)


Error appears

B4X:
ResponseError. Reason: Internal Server Error, Response: UPDATE tbl_assesment_kecanggihan SET idtingkatkecanggihan=?, skor=? Where id_assesment_kecanggihan=?, VALUES ('2' ,'1' ,'111'\nYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?, skor=? Where id_assesment_kecanggihan=?, VALUES ('2' ,'1' ,'111'' at line 1


Can anyone help me from this error?

Thank you before
 

udg

Expert
Licensed User
Longtime User
Missing closing parenthese
IDAssCanggih &"'"), UpdateAssCanggih)
It should be IDAssCanggih &"')")

It is strongly suggested to use it in the form:
sql.ExecNonQuery2("UPDATE students SET image = ? WHERE id = ?", Array(b, 10))
 
Last edited:
Upvote 0

Puthut Wibowo

Member
Licensed User
B4X:
 ,'" & IDAssCanggih &"')", UpdateAssCanggih)

still error.
B4X:
Error description: Invalid number of parentheses.
Error occurred on line: 624 (FrmCLV)
ExecuteRemoteQuery(("UPDATE tbl_assesment_kecanggihan SET idtingkatkecanggihan=?, skor=? Where id_assesment_kecanggihan=?, VALUES ('" & IdCanggih & "' ,'" & SpinPenilaian.SelectedItem & "' ,'" & IDAssCanggih &"')", UpdateAssCanggih)




Missing closing parenthese

It should be IDAssCanggih &"')")

It is strongly suggested to use it in the form:
sql.ExecNonQuery2("UPDATE students SET image = ? WHERE id = ?", Array(b, 10))
 
Upvote 0

udg

Expert
Licensed User
Longtime User
B4X:
ExecuteRemoteQuery(("UPDATE tbl_assesment_kecanggihan SET idtingkatkecanggihan=?, skor=? Where id_assesment_kecanggihan=?", Array( IdCanggih, SpinPenilaian.SelectedItem , IDAssCanggih), UpdateAssCanggih)
 
Upvote 0

Puthut Wibowo

Member
Licensed User
Still error :

Error description: Invalid number of parentheses.
Error occurred on line: 627 (FrmCLV)

im trying insert ) after IDAssCanggih)
B4X:
, IDAssCanggih))

but still error compiling
Error compiling program.
Error description: ')' expected.
Error occurred on line: 627


B4X:
ExecuteRemoteQuery(("UPDATE tbl_assesment_kecanggihan SET idtingkatkecanggihan=?, skor=? Where id_assesment_kecanggihan=?", Array( IdCanggih, SpinPenilaian.SelectedItem , IDAssCanggih), UpdateAssCanggih)
 
Upvote 0

Puthut Wibowo

Member
Licensed User
Finally im find the answer :
B4X:
ExecuteRemoteQuery("UPDATE tbl_assesment_kecanggihan SET idtingkatkecanggihan = '" & IdCanggih & "', skor = '" & SpinPenilaian.SelectedItem & "' WHERE id_assesment_kecanggihan = " & IDAssCanggih, UpdateAssCanggih)
 
Upvote 0
Top