U
U
usertypical13r2021-11-14 19:10:39
Python
usertypical13r, 2021-11-14 19:10:39

How to get cells into a variable?

I ran into such a problem, I need to get several url addresses (cells from the database) that are attached to 1 ID and put them in the list so that I can use them comfortably later, but as a result I get a tuple.

photoUrl = []

for item in cur.execute("SELECT `url` FROM `photo`  WHERE (id = ...);")
    photoUrl.append(item)
print(photoUrl)

Conclusion:

[('url1',)]

need:

[url1]

Tell me, please, what can be done.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question