[16-Aug-2026 01:03:07 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters in /home/leotwcun/leotrix.leotrix-ai.com/Backend_school_portal/api/bulk_generate_results.php:163
Stack trace:
#0 /home/leotwcun/leotrix.leotrix-ai.com/Backend_school_portal/api/bulk_generate_results.php(163): PDOStatement->execute()
#1 {main}
  thrown in /home/leotwcun/leotrix.leotrix-ai.com/Backend_school_portal/api/bulk_generate_results.php on line 163
[02-Oct-2026 08:15:21 UTC] 📡 Announcements API called: student_id=, class_id=, limit=20, offset=0
[02-Oct-2026 08:15:21 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 08:15:21 UTC] No class_id found - will fetch all announcements
[02-Oct-2026 08:15:21 UTC] ✅ Fetched 0 announcements
[02-Oct-2026 08:15:21 UTC] ✅ Total announcements: 0
[02-Oct-2026 08:15:21 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 08:15:22 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 08:15:22 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 08:19:46 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 08:19:46 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 08:20:48 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 08:20:57 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 08:20:57 UTC] DEBUG_STATS [TERM] student=0 class=4 session=4 → Rows: 433
[02-Oct-2026 08:24:11 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 08:24:11 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 08:24:28 UTC] DEBUG_STATS [TERM] student=0 class=4 session=4 → Rows: 433
[02-Oct-2026 08:25:08 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 09:06:35 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 09:06:35 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 09:06:35 UTC] 📡 Announcements API called: student_id=, class_id=, limit=20, offset=0
[02-Oct-2026 09:06:35 UTC] No class_id found - will fetch all announcements
[02-Oct-2026 09:06:35 UTC] ✅ Fetched 0 announcements
[02-Oct-2026 09:06:35 UTC] ✅ Total announcements: 0
[02-Oct-2026 09:06:35 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 09:06:35 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 09:07:44 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 09:08:35 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 09:08:35 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 09:09:35 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 09:10:03 UTC] 🔐 LOGIN API: Incoming request
[02-Oct-2026 09:10:03 UTC]    Sanitized Email: jude@gscis.com
[02-Oct-2026 09:10:03 UTC]    Executing query to find user by email
[02-Oct-2026 09:10:03 UTC] ✅ User found: Mr Jude
[02-Oct-2026 09:10:03 UTC]    User ID: 4
[02-Oct-2026 09:10:03 UTC]    Role: teacher
[02-Oct-2026 09:10:03 UTC]    Verifying password...
[02-Oct-2026 09:10:03 UTC]    ✅ Password verified as PLAIN TEXT
[02-Oct-2026 09:10:03 UTC] ✅ Password verified successfully
[02-Oct-2026 09:10:03 UTC]    Normalized teacher_role: form_teacher
[02-Oct-2026 09:10:03 UTC]    Fetching active academic session...
[02-Oct-2026 09:10:03 UTC]    Active session ID: 4
[02-Oct-2026 09:10:03 UTC]    Fetching assigned subjects...
[02-Oct-2026 09:10:03 UTC]    Found 17 assigned subject(s)
[02-Oct-2026 09:10:03 UTC]    Updating last_login timestamp...
[02-Oct-2026 09:10:03 UTC] ✅ LOGIN SUCCESSFUL
[02-Oct-2026 09:10:07 UTC] 📚 STUDENT GET: Fetching students for class_id=4
[02-Oct-2026 09:10:07 UTC] ✅ STUDENT GET: Found 27 students
[02-Oct-2026 09:10:12 UTC] DEBUG_STATS [TERM] student=0 class=4 session=4 → Rows: 433
[02-Oct-2026 09:10:46 UTC] 🔐 LOGIN API: Incoming request
[02-Oct-2026 09:10:46 UTC]    Sanitized Email: admin@school.com
[02-Oct-2026 09:10:46 UTC]    Executing query to find user by email
[02-Oct-2026 09:10:46 UTC] ✅ User found: School Admin
[02-Oct-2026 09:10:46 UTC]    User ID: 1
[02-Oct-2026 09:10:46 UTC]    Role: admin
[02-Oct-2026 09:10:46 UTC]    Verifying password...
[02-Oct-2026 09:10:46 UTC]    ✅ Password verified as PLAIN TEXT
[02-Oct-2026 09:10:46 UTC] ✅ Password verified successfully
[02-Oct-2026 09:10:46 UTC]    Normalized teacher_role: mentor
[02-Oct-2026 09:10:46 UTC]    Updating last_login timestamp...
[02-Oct-2026 09:10:46 UTC] ✅ LOGIN SUCCESSFUL
[02-Oct-2026 09:10:48 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 09:10:48 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 09:17:07 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 09:17:07 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 09:17:20 UTC] DEBUG_STATS [TERM] student=0 class=4 session=4 → Rows: 433
[02-Oct-2026 09:18:03 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 09:18:56 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 09:18:56 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 09:19:02 UTC] DEBUG_STATS [TERM] student=0 class=4 session=4 → Rows: 433
[02-Oct-2026 09:19:49 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 09:19:57 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 09:24:40 UTC] 🔐 LOGIN API: Incoming request
[02-Oct-2026 09:24:40 UTC]    Sanitized Email: admin@school.com
[02-Oct-2026 09:24:40 UTC]    Executing query to find user by email
[02-Oct-2026 09:24:40 UTC] ✅ User found: School Admin
[02-Oct-2026 09:24:40 UTC]    User ID: 1
[02-Oct-2026 09:24:40 UTC]    Role: admin
[02-Oct-2026 09:24:40 UTC]    Verifying password...
[02-Oct-2026 09:24:40 UTC]    ✅ Password verified as PLAIN TEXT
[02-Oct-2026 09:24:40 UTC] ✅ Password verified successfully
[02-Oct-2026 09:24:40 UTC]    Normalized teacher_role: mentor
[02-Oct-2026 09:24:40 UTC]    Updating last_login timestamp...
[02-Oct-2026 09:24:40 UTC] ✅ LOGIN SUCCESSFUL
[02-Oct-2026 09:24:42 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 09:24:42 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 09:24:42 UTC] 📡 Announcements API called: student_id=, class_id=, limit=20, offset=0
[02-Oct-2026 09:24:42 UTC] No class_id found - will fetch all announcements
[02-Oct-2026 09:24:42 UTC] ✅ Fetched 0 announcements
[02-Oct-2026 09:24:42 UTC] ✅ Total announcements: 0
[02-Oct-2026 09:24:42 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 09:24:42 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 09:26:12 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 09:26:12 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 09:28:13 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 09:28:13 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 10:00:03 UTC] 🔐 LOGIN API: Incoming request
[02-Oct-2026 10:00:03 UTC]    Sanitized Email: admin@school.com
[02-Oct-2026 10:00:03 UTC]    Executing query to find user by email
[02-Oct-2026 10:00:03 UTC] ✅ User found: School Admin
[02-Oct-2026 10:00:03 UTC]    User ID: 1
[02-Oct-2026 10:00:03 UTC]    Role: admin
[02-Oct-2026 10:00:03 UTC]    Verifying password...
[02-Oct-2026 10:00:03 UTC]    ✅ Password verified as PLAIN TEXT
[02-Oct-2026 10:00:03 UTC] ✅ Password verified successfully
[02-Oct-2026 10:00:03 UTC]    Normalized teacher_role: mentor
[02-Oct-2026 10:00:03 UTC]    Updating last_login timestamp...
[02-Oct-2026 10:00:03 UTC] ✅ LOGIN SUCCESSFUL
[02-Oct-2026 10:00:06 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 10:00:06 UTC] 📡 Announcements API called: student_id=, class_id=, limit=20, offset=0
[02-Oct-2026 10:00:06 UTC] No class_id found - will fetch all announcements
[02-Oct-2026 10:00:06 UTC] ✅ Fetched 0 announcements
[02-Oct-2026 10:00:06 UTC] ✅ Total announcements: 0
[02-Oct-2026 10:00:06 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 10:00:06 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 10:00:06 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 10:00:36 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 10:00:36 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 10:00:47 UTC] DEBUG_STATS [TERM] student=0 class=4 session=4 → Rows: 433
[02-Oct-2026 10:01:42 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 10:05:08 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 10:05:08 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 10:06:06 UTC] DEBUG_STATS [TERM] student=0 class=6 session=4 → Rows: 473
[02-Oct-2026 10:06:31 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 10:11:05 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 10:11:05 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 10:12:22 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 10:35:15 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 10:35:15 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 10:36:21 UTC] DEBUG_STATS [TERM] student=0 class=7 session=4 → Rows: 780
[02-Oct-2026 10:36:23 UTC] DEBUG_STATS [TERM] student=0 class=4 session=4 → Rows: 433
[02-Oct-2026 10:44:56 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 10:44:56 UTC] ✅ STUDENT GET: Found 386 students
[02-Oct-2026 10:44:58 UTC] 📡 Announcements API called: student_id=, class_id=, limit=20, offset=0
[02-Oct-2026 10:44:58 UTC] No class_id found - will fetch all announcements
[02-Oct-2026 10:44:58 UTC] ✅ Fetched 0 announcements
[02-Oct-2026 10:44:58 UTC] ✅ Total announcements: 0
[02-Oct-2026 10:44:58 UTC] 📚 STUDENT GET: Fetching all students
[02-Oct-2026 10:44:58 UTC] ✅ STUDENT GET: Found 386 students
[03-Oct-2026 05:38:45 UTC] 📚 STUDENT GET: Fetching all students
[03-Oct-2026 05:38:45 UTC] ✅ STUDENT GET: Found 386 students
[03-Oct-2026 05:38:45 UTC] 📡 Announcements API called: student_id=, class_id=, limit=20, offset=0
[03-Oct-2026 05:38:45 UTC] No class_id found - will fetch all announcements
[03-Oct-2026 05:38:45 UTC] ✅ Fetched 0 announcements
[03-Oct-2026 05:38:45 UTC] ✅ Total announcements: 0
[03-Oct-2026 05:38:46 UTC] 📚 STUDENT GET: Fetching all students
[03-Oct-2026 05:38:46 UTC] ✅ STUDENT GET: Found 386 students
