I am using lots of checkbox objects which are all Saving to the database and reading back into the Checkbox objects correctly, however I cannot get the UPDATE SQL command to work. What is the correct way to write this code? This is what I have till now:
db.ExecuteSQL("UPDATE Stories SET chkForshadowingStep1 = '" + CCStep1ActionApplied.chkForshadowingStep1.getBoolean + "' WHERE ID = " + StoryID_Selected)
Sorry if I am giving the impression that I’m ignoring someone, I am trying to learn things maybe slower than expected. I will have a look at prepared Statements, thanks for your help.
How is the data stored in your database? 1/0, Y/N, TRUE/FALSE? If you’re building your own query string, you need to know that and convert to the right string version of your boolean value, so the database can make sense of it. If you use a prepared statement, you don’t have to think about it.
Also, how do you store the data in the first place? That could help us direct you to the correct syntax. If you’re using a DatabaseRecord/DatabaseRow, it’s using a prepared statement behind the scenes, so updating with a prepared statement would be the most consistent approach.