K
K
Kendric Folkin2021-01-18 11:36:44
Python
Kendric Folkin, 2021-01-18 11:36:44

How to make sure that when SQL query, the response does not come in an array?

In this snippet of code, I get the ID from the database
6005484b3192d871363440.jpeg
But the data comes to me in an array The
60054864da58b435100289.png
question is, how to get the data from the array? And provided that there was no id in the database, there was no error

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
ayazer, 2021-01-18
@kendric

cursor.fetchone(...)
or get
a[0]

S
SashaN69, 2021-01-18
@SashaN69

result = cursor.fetchone()
my_id = result[0]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question