When trying to view a student profile or load student-related dashboards in Unlimited Edu Firm – School & College Information Management System, you may encounter an empty view, broken layout, or missing data.

This often happens when related records are missing in supporting tables like:

  • student_extra_infos

  • student_placements

  • student_scholarships


🧭 Reason:

These three tables are dependent on student records to show extended information like:

  • Annual fees, bank details (student_extra_infos)

  • Job placement data (student_placements)

  • Scholarship tracking (student_scholarships)

If the records for a particular students.id are missing in any of these tables, the student view becomes invalid.


✅ Solution:

Run the following SQL queries to insert missing entries for all students into the respective tables with default values.


🔹 1. Fix missing student_extra_infos

INSERT INTO student_extra_infos (
students_id, created_at, updated_at, status
)
SELECT id, NOW(), NOW(), 1
FROM students
WHERE id NOT IN (
SELECT students_id FROM student_extra_infos
);

🔹 2. Fix missing student_placements

INSERT INTO student_placements (
students_id, created_at, updated_at, status
)
SELECT id, NOW(), NOW(), 1
FROM students
WHERE id NOT IN (
SELECT students_id FROM student_placements
);

🔹 3. Fix missing student_scholarships (default scholarships_id = 1)

INSERT INTO student_scholarships (
students_id, created_at, updated_at, scholarships_id, status
)
SELECT id, NOW(), NOW(), 1, 1
FROM students
WHERE id NOT IN (
SELECT students_id FROM student_scholarships
);

💡 Note:

  • These queries only insert records for students that are not already present in the corresponding tables.

  • Adjust status or other defaults as per your project logic.

  • Run them from a MySQL client, Laravel Tinker DB facade, or create a migration/seeder.


✅ Result:

After running the above SQL queries:

  • The student view will load properly.

  • You’ll avoid “null object” errors or broken relationship views.

  • The system becomes more robust with consistent relational data.

LEAVE A REPLY

Please enter your comment!
Please enter your name here