Extended UPSC Registration Project
Extended UPSC Registration Project
import mysql.connector
import time
from datetime import datetime
def slow_print(text):
for char in text:
print(char, end='', flush=True)
time.sleep(0.01)
print()
def line():
print("-" * 50)
try:
cursor.execute("""
INSERT INTO candidates (full_name, father_name, mother_name, dob, gender,
nationality, category, disability_status, email, phone, aadhaar_no, address,
state, exam_center, qualification)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
""", (
full_name, father_name, mother_name, dob, gender, nationality, category,
disability_status, email, phone, aadhaar_no, address, state, exam_center,
qualification
))
conn.commit()
candidate_id = cursor.lastrowid
cursor.execute("INSERT INTO login (user_id, password, candidate_id) VALUES (%s, %s, %s)",
(user_id, password, candidate_id))
conn.commit()
print("Registration Complete. Your ID:", candidate_id)
except Exception as e:
print("Error:", e)
conn.rollback()
main()
cursor.close()
conn.close()