'getting an error while fetching data from database (mysql). n="+".join(n) TypeError: can only join an iterable

conn = mysql.connector.connect(host="localhost", user="root", password="", database="Attendance") my_cursor = conn.cursor()

                            my_cursor.execute("select Name from student where Student_id="+str(id))
                            n=my_cursor.fetchone()
                            n="+".join(n)


Solution 1:[1]

Please check the value of n before joining if it is an iterable. Probably it’s None.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Markus