def getStudentsByClassId(self, classid): sql = 'Select * From Student Where classid = %s' value = (classid, ) self.cursor.execute(sql, value) try: obj = self.cursor.fetchall() return Student.CreateStudent(obj) except mysql.connector.Error as err: print('Hata: ', err)
def getStudentById(self, id): sql = "select * from student where id = %s" value = (id, ) self.cursor.execute(sql, value) try: obj = self.cursor.fetchone() return Student.CreateStudent(obj) except mysql.connector.Error as err: print('Error:', err)
def getStudentsByClassId(self, ClassId): sql = "select * from student where ClassId=%s" value = (ClassId,) self.cursor.execute(sql, value) try: obj = self.cursor.fetchall() return Student.CreateStudent(obj) except mysql.connector.Error as err: print('hata', err)
def getStudentByClassId(self, classid): sql = "Select * from student where classid =%s" value = (classid, ) self.cursor.execute(sql, value) try: obj = self.cursor.fetchall() return Student.CreateStudent(obj) except mysql.connector.Error as err: print("Err: ", err)