Home > OS >  getting an error while fetching data from database (mysql). n=" ".join(n) TypeError: can o
getting an error while fetching data from database (mysql). n=" ".join(n) TypeError: can o

Time:05-14

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)

CodePudding user response:

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

  • Related