You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromssql.connectorimportConnectionConnection(creds= (user, password, host, db)) #credentials for connecting to mysql server.#sample 1. With Dictionary and Named Parameters.user=connection.query("SELECT * FROM Mytable WHERE Name = %(username)s;", {"username": "XYZ"})
#sample 2. With List.user=connection.query("SELECT * FROM Mytable WHERE Name = %s;", ["XYZ",])
#sample 3. With Tuple.user=connection.query("SELECT * FROM Mytable WHERE Name = %s;", ("XYZ",))