MySQL WHERE pointing to custom property..?

I have the following update query:

system.db.runUpdateQuery(“UPDATE test_history SET productserial_name = ‘%s’ WHERE test_ID = event.source.parent.test_ID” % (serial), ‘Customer’)

The WHERE is looking at the INT of custom property (event.source.parent.test_ID) which is a query pulling the last test_ID field in the table. I’ve tried brackets, quotes, and all others but it’s not liking the syntax…Using this same syntax, I can put a number in and it updates the right test_ID for that row…what’s the proper syntax of a ‘WHERE’ clause to look at a custom property value?

Thank you in advance! :slight_smile:

Hi, you should do it like this:

system.db.runPrepUpdate("UPDATE test_history SET productserial_name=? WHERE test_ID=?", [serial,event.source.parent.test_ID], "Customer")


AWESOME! Thanks Nick