Database Debug Information

Database Connection

Database connected successfully!

Server info: 10.4.32-MariaDB

Host info: localhost via TCP/IP

COURSES Table Structure

Field Type Null Key Default Extra
course_id int(11) NO PRI auto_increment
teacher_id int(11) NO MUL
category_id int(11) NO MUL
title varchar(255) NO
description text YES
thumbnail varchar(255) YES
price decimal(10,2) YES 0.00
is_published tinyint(1) YES 0
created_at timestamp NO current_timestamp()
updated_at timestamp NO current_timestamp() on update current_timestamp()

CATEGORIES Table Structure

Field Type Null Key Default Extra
category_id int(11) NO PRI auto_increment
category_name varchar(100) NO
description text YES
created_at timestamp NO current_timestamp()

Foreign Key Constraints

Constraint Name Table Column Referenced Table Referenced Column
courses_ibfk_1 courses teacher_id users user_id
courses_ibfk_2 courses category_id categories category_id

CATEGORIES Table Data

category_idcategory_namedescriptioncreated_at
1ProgrammingLearn programming languages and software development2025-06-13 18:00:04
2MathematicsMathematics courses from basic to advanced2025-06-13 18:00:04
3BusinessBusiness, management, and entrepreneurship2025-06-13 18:00:04
4SciencePhysics, chemistry, biology and more2025-06-13 18:00:04
5LanguagesLearn new languages2025-06-13 18:00:04
6TechnologyModern tech trends and applications2025-06-13 18:00:04
7ArtsCreative arts and design principles2025-06-13 18:00:04

Sample COURSES Data

course_idteacher_idcategory_idtitledescriptionthumbnailpriceis_publishedcreated_atupdated_at
121Introduction to Python ProgrammingLearn Python programming from scratch with practical examples/assets/images/courses/python.jpg49.9912025-06-13 18:00:042025-06-13 18:00:04
232Advanced MathematicsTake your math skills to the next level with advanced topics/assets/images/courses/math.jpg39.9912025-06-13 18:00:042025-06-13 18:00:04
321Web Development BootcampComprehensive web development course covering HTML, CSS, and JavaScript/assets/images/courses/webdev.jpg59.9912025-06-13 18:00:042025-06-13 18:00:04
434Introduction to PhysicsUnderstand the fundamental principles of physics/assets/images/courses/physics.jpg44.9912025-06-13 18:00:042025-06-13 18:00:04

Test Query Simulation

Simulating course insert with category_id = 1

Category with ID 1 exists: {"category_id":"1","category_name":"Programming","description":"Learn programming languages and software development","created_at":"2025-06-13 18:00:04"}

Sample Query That Would Run:

INSERT INTO courses (teacher_id, title, description, category_id, thumbnail, price, is_published) 
                VALUES (6, 'Sample Course', 'This is a test description', 1, '../uploads/thumbnails/sample.jpg', 29.99, 1)

Testing Query Execution (Dry Run):

Query would execute successfully!

Transaction rolled back, no data was inserted.

HTML Form Category Values

The category dropdown in the form has these values:

Value (sent to server) Display Text Corresponding Category ID (if found)
programming Programming Checking...
design Design Checking...
business Business Checking...
marketing Marketing Checking...
language Language Checking...
other Other Checking...

Recommendations

Debug Log

Check course_creation_debug.log for detailed operation logs.