Showing
4 changed files
with
7 additions
and
6 deletions
... | @@ -73,9 +73,9 @@ async def thread(websocket, path): | ... | @@ -73,9 +73,9 @@ async def thread(websocket, path): |
73 | student_name = data['student_name'] | 73 | student_name = data['student_name'] |
74 | # 학생을 찾음 | 74 | # 학생을 찾음 |
75 | sql = "SELECT student_id FROM student WHERE student_id = %s;" | 75 | sql = "SELECT student_id FROM student WHERE student_id = %s;" |
76 | - rows_count = cursor.execute(sql, (student_id)) | 76 | + cursor.execute(sql, (student_id)) |
77 | # DB에 학생이 없으면 등록 | 77 | # DB에 학생이 없으면 등록 |
78 | - if rows_count == 0: | 78 | + if cursor.rowcount == 0: |
79 | sql = "INSERT INTO student(student_id, student_name) VALUES (%s, %s)" | 79 | sql = "INSERT INTO student(student_id, student_name) VALUES (%s, %s)" |
80 | cursor.execute(sql, (student_id, student_name)) | 80 | cursor.execute(sql, (student_id, student_name)) |
81 | sql = "INSERT INTO lecture_students(lecture_id, student_id) VALUES (%s, %s)" | 81 | sql = "INSERT INTO lecture_students(lecture_id, student_id) VALUES (%s, %s)" | ... | ... |
-
Please register or login to post a comment