OOP PROJECT
  • Sqlit3 Installation
  • Database Class
    • টেবিল তৈরী করা
  • Student Information Crud
    • insert student
    • get all student
    • get student(id)
    • Update Student
    • Delete Student
    • Complete Code
Powered by GitBook
On this page
  1. Student Information Crud

insert student

PreviousStudent Information CrudNextget all student

Last updated 2 years ago

def insert_student(self):
    sql = 'INSERT INTO students (name,email,phone) values (?,?,?)'
    values = (self.name,self.email,self.phone)
    self.db.cursor.execute(sql,values)
    self.db.connection.commit()

# Create Student Object
student = Student()
# Modify Student Object Property Value
student.name= 'olee'
student.email = 'olee.techs@gmail.com'
student.phone = '01953-6649667'
# Insert  
student.insert_student()

কোডটি রান করার পর আমরা যদি ডেটাবেজ এ ঢুকে চেক করি তাহলে students নামে টেবিল এ নিচের মত দেখতে পাবো।