Improve SQL INSERT query to avoid sql injections
问题 I am using pymyql/mysql-connector to write the messages to mysql database. The messages are processed on callback (paho.mqtt callback) from mqtt broker.I have 4 different tables and based on the message type, I am inserting messages into database. I have written the insert queries as below. this way of writing leads to sql injections it seems.Any suggestions how can I improve the insert query statements? # callback attached to paho.mqtt.client def on_message(self, client, userdata, msg): if