I have a 2D list 'sorted_list' and need to modify selected elements of the list. The list consists of a variable number of sub lists, each - with 3 elements. I need to modify the 3rd element of each sub list. For example :
[[2, 25, 1], [1, 26, 2], [1, 27, 3], [1, 29, 4]] .... I need to replace elements 1, 2, 3 and 4 with their corresponding names obtained by looking up a mysql table. The revised list could look something like
[[2, 25, NAME1], [1, 26, NAME2], [1, 27, NAME3], [1, 29, NAME4]]
I have made the attached Function 'convertPizzaNameCOMBO(sor
which should produce the modified list (attached). It gives however the attached error message indicating SQL syntax problem (see attached error message)
The function seems to be working correctly from a looping standpoint. For example, if I replace sorted_list[col]
with 20 (which is a legitimate ID for looking up the table) - all the targeted elements in the list will be changed to the name corresponding to 20. So it appear to be some mysql syntax problem ?
Hopefully you can spot the error - or if my basic approach is incorrect, maybe you can point me in the right direction