Python Array Add Element If Not Exists In Mysql Query Update