This Is A Basic Implementation of The Frontend Logic
This Is A Basic Implementation of The Frontend Logic
# You can extend it by integrating additional tables and improving the UI for better visual appeal.
import tkinter as tk
from tkinter import messagebox
import mysql.connector
# Database connection
def connect_db():
return mysql.connector.connect(
host="localhost",
user="appuser",
password="apppassword",
database="expFinal"
)
try:
cursor.execute(
"INSERT INTO college (college_code, college_name, col_add) VALUES (%s, %s, %s)",
(college_code, college_name, col_add)
)
conn.commit()
messagebox.showinfo("Success", "College added successfully!")
except Exception as e:
messagebox.showerror("Error", str(e))
finally:
cursor.close()
conn.close()
# Setup UI
root = tk.Tk()
root.title("College Management")
root.geometry("400x300")
# College inputs
tk.Label(root, text="College Code").pack(pady=5)
entry_college_code = tk.Entry(root)
entry_college_code.pack(pady=5)