Database Check: As mentioned before, you must run this in your database (e.g., phpMyAdmin) so it stops looking for a slug: ALTER TABLE courses DROP INDEX slug; (If you don't do this, MySQL might still throw an error if it finds a duplicate value in that column). Once you replace the method with the one above and delete the helper function at the bottom, the undefined method error will disappear. Does it work now?
Course Overview Level: Beginner to Advanced Prerequisites: Solid understanding of HTML structure and basic SQL database concepts Goal: Master server-side programming, form handling, session security, object-oriented PHP architecture, and database integrations. Module 1: PHP Foundations and Environment Setup Introduction to the Server Side: Understanding client-server architecture and how a web server interprets PHP before serving HTML to the browser. Development Environment Setup: Configuring local development servers like XAMPP or Laragon and verifying the PHP installation. Basic Syntax and Echoing: Managing opening and closing PHP tags, statement terminators, and outputting content via echo and print. Variables and Constants: Declaring dynamic variables with the dollar sign and setting unchangeable application values with the define function. Data Types and Sizing: Working with strings, integers, floats, booleans, arrays, objects, and null values. Module 2: Control Flow, Logic, and Arrays Conditional Evaluation: Directing application flow using if, else, elseif, and switch statements. Looping Mechanisms: Automating repetitive tasks using for, while, do-while, and foreach for data rendering. Working with Arrays: Building and manipulating indexed arrays, associative key-value arrays, and multi-dimensional data structures. Array Core Functions: Transforming data lists using array-push, array-pop, count, in-array, and array-merge. Module 3: Functions and Variable Scope Declaring Custom Functions: Building reusable blocks of code with custom naming parameters and return statements. Type Hinting and Return Types: Writing clean, modern PHP by explicitly enforcing data types for input parameters and outputs. Variable Scope Management: Navigating global vs local variable execution spaces and leveraging the global keyword. Built-In Helper Functions: Utilizing string formatting functions, mathematical calculators, and real-time date-time utilities. Module 4: Form Handling and User Input Processing Superglobal Variables: Working with system-level variables like SERVER, GET, and POST. Form Submission Processing: Safely capturing user entry data transmitted from HTML forms. Data Sanitization: Scrubbing user inputs using filter-var and htmlspecialchars to block malicious code injection attacks. Form Validation Patterns: Implementing mandatory field checking, email verification strings, and numerical range verification logic. Module 5: State Management, Cookies, and Sessions Understanding Stateless Protocol: How HTTP functions and why data tracking layers are required. PHP Sessions: Initiating secure tracking using session-start, storing global variables, and destroying user sessions on logout. Cookie Mechanics: Setting temporary or permanent browser client trackers using setcookie and reading stored values safely. Authentication Security: Restricting page views to registered users by tracking valid session state flags. Module 6: Object-Oriented PHP OOP Introduction to Classes and Objects: Building application blueprints with custom properties and internal methods. The Constructor Method: Automatically priming new objects with custom data payloads using the construct method. Access Modifiers: Enforcing strict data encapsulation using public, private, and protected visibility states. Inheritance and Polymorphism: Extending parent classes to child classes using the extends keyword to reuse architectural logic. Module 7: Database Integration with MySQL Connecting via PDO: Establishing secure database connections using the modern PHP Data Objects layer. Prepared Statements Architecture: Securing web applications against SQL Injection vulnerabilities using parameter binding. CRUD Data Operations: Writing script routines to Create, Read, Update, and Delete database records directly from user dashboards. Dynamic Layout Population: Fetching rows from database structures and looping them clean HTML tables and card containers. Capstone Portfolio Projects To graduate from this course, students will build two real-world, backend-driven applications demonstrating backend development mastery: Project 1: A Secure User Authentication and Membership Portal Students will build a complete user registration and login engine. The backend must securely hash passwords using modern encryption algorithms before saving them to a database. It features validation feedback, state tracking sessions for private dashboards, custom profile modification fields, and safe logout handlers. Project 2: A Dynamic Content Management System CMS and Blog Engine Students will architect a robust backend platform that allows administrators to create, edit, publish, and delete blog posts or product listings from an admin panel. The system will leverage a MySQL database backend connected via secure PDO parameters. It requires categorized post filtering, image upload processing with file extension validation, and automated dynamic layout population across user-facing pages.