0
I made a query in mysql with python and show the result:
cursor = db.cursor()
cursor.execute("SELECT Dias, HoraConsulta, HoraSaida, nome, Consulta, centrodb.LocalConsulta.Descricao, Contato FROM centrodb.RegistoConsultas LEFT OUTER JOIN centrodb.LocalConsulta ON centrodb.LocalConsulta.Id = centrodb.RegistoConsultas.`Local` LEFT OUTER JOIN centrodb.utentes ON centrodb.utentes.codigoutente = centrodb.RegistoConsultas.Utente LEFT OUTER JOIN centrodb.DiasSemana ON centrodb.DiasSemana.Id = centrodb.RegistoConsultas.DiaSemana")
myresult = cursor.fetchone()
print(myresult)
Instead of print, I intend to store each column returned in the python query in variables
Which is the way out of
print
? What type is the objectmyresult
? A dictionary?– Woss
@Anderson Carlos Woss, the print was just to print the line as a test. Now my question is how to store the data returned from each column in variables
– Bruno
What about the type of the object? It’s an actual dictionary?
– Woss