
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Explore the basics of PHP, a server-side language for dynamic web pages, including form data handling, database operations, access control, and generating dynamic page content.
Install php locally with two methods: xampp on Windows (localhost, Apache, port 8443) or online sandboxes like online php.io and python.io to run test code.
Master php syntax basics by embedding php in html with opening tag <?php and closing tag. Use echo to print hello world and a paragraph tag, ending with a semicolon.
Explore comments in code: use # or // for single-line comments and /* ... */ for multi-line comments; they are ignored by the program and help document logic.
Explore how php variables start with a dollar sign to store strings, numbers, and underscores, cannot begin with a number, and how echo prints them.
Explore PHP data types, including string, int, float, bool, array, and null, and learn how to declare, concatenate strings with the dot operator, and inspect variables with var_dump.
Master arithmetic operators in PHP to manipulate numbers, including addition, subtraction, multiplication, division, modulo, and the increment and decrement operators, with example values x=10 and y=5.
Master assignment operators in PHP by updating variables with a wallet and shoe example. Learn how -= and += simplify arithmetic, and see modulo, multiplication, and addition in action.
Learn how PHP comparison operators compare numbers and strings, and when to use the equality, identical, and not identical operators to respect data types.
Explore how logical operators combine conditions in PHP, including and (&&), or (||), not (!), and xor, with examples showing when both, either, or exactly one condition is true.
Discover how PHP arrays store multiple values of different data types, using array() or short syntax with brackets, and access elements by zero-based indexes for printing.
Explore associative arrays in PHP by using named keys and the arrow operator. Compare array(), short syntax, and modern square-bracket syntax from PHP 7 onward to map names to values.
Learn how to work with multidimensional arrays in PHP, building two-dimensional and nested arrays of fruits and nutrients, accessing values with echo and square bracket syntax, tailored for beginners.
Master conditional statements in PHP using if, else, and elseif with syntax and practical examples, such as checking legal age and printing appropriate messages.
Learn how to use the switch statement as an alternative to if else, define cases, apply break, and add a default clause to handle unmatched values.
Explore how the while loop repeats code while a condition remains true, using a counting example up to 500. Learn various increment methods and how to prevent infinite loops.
Learn the do while loop in PHP, which runs code at least once before evaluating the condition, contrasting it with the while loop, and see a legal age example.
Master the for loop by initializing a counter, testing a condition, and updating the counter to run code; the example counts from 0 to 19 and prints 'I love vegetables'.
Demonstrate using the foreach loop to iterate over arrays and objects, showing the syntax using the as keyword to access keys and values and print each element, including associative arrays.
Learn how to use PHP functions, including built-in ones like date and print, and create user defined functions with the function keyword, camelcase naming, and function calls.
Explore parameters and arguments in PHP functions, learn how declarations define variables and how calls pass values, and use default arguments to handle omitted values.
Explore how the return statement in a function sends back the computed value and stops execution, demonstrated with a two-parameter addition returning the answer.
Explore PHP superglobals, focusing on the get and post methods, how form data is stored in $_GET and $_POST, and why GET exposes data in the URL.
Explore how the post method hides form data in the http body, accessed via the PHP post superglobal array, echoed for testing, and suited for passwords.
Understand the PHP session super global, storing data on the server and comparing it to cookies. Start a session, set name and cart, then unset and destroy.
Identify users with cookies by storing small files on the client; use setcookie to create cookies (name, value, expiration, path, domain, secure, httpOnly) and inspect $_COOKIE, while avoiding sensitive data.
See how PHP and HTML work together, with PHP as the backend language powering content inside static HTML frontends, using echo to render H1 tags unseen by users.
Explore front-end form validation with HTML5 built-in features such as required and minlength, demonstrated on a login form to show client-side validation without server interaction.
Demonstrate back-end validation's importance by showing how PHP reads post data via the post superglobal and sanitizes username and password with trim, stripslashes, and converting special characters to HTML entities.
Build a simple contact form with validation to notify users of errors, using name, email, gender, message, and submit inputs, with the PHP back end introduced in the next lesson.
Master the PHP backend by processing a form with name, email, gender, and message via post, validating inputs, and displaying the final output securely.
Create variables to hold name, email, and gender error messages; set them when fields are empty and echo them beside the form fields, then note a next lesson on validation.
Improve form security by implementing a reusable input validator that trims, strips slashes, and removes special characters, then validates emails with filter_var.
Databases power account creation, emails, and login flows by storing and organizing data. Explore MySQL, an open source relational DBMS, with phpMyAdmin for a user-friendly interface and CRUD basics.
Start the Apache server and MySQL, then open phpMyAdmin at localhost to create a database named php, and prepare to build your first table.
Create a users table in phpmyadmin, define id as an auto-incrementing primary key, add username and password as varchar(200), and learn to create or drop tables with sql.
Create data entries in a users table using phpMyAdmin's insert tab, using autoincrement IDs and the insert into users syntax with username and password values.
Learn how to verify user data with SQL select queries in a MySQL database, including selecting usernames, checking passwords with where clauses, and handling invalid credentials.
Learn how to update a user password using the SQL update statement on the users table by setting the password and using where to target the correct username.
Learn how the SQL delete command removes data by deleting from the users table where the username equals matter, and see the single row affected after execution.
Connect to your MySQL database from PHP using the MySQLi extension, declare host, user, password, and database name, and handle success or error messages.
Connect to a database and perform create (insert) operations with PHP and MySQL by adding a username and password to the users table, then verify success.
Learn how to read data with a SQL select in PHP, retrieve rows from the users table, and print usernames and passwords using mysqli functions like num_rows and fetch_assoc.
Learn how to update a user's password in MySQL with an update query on the users table, using set and where clauses, and verify the change after execution.
Demonstrate deleting a user in PHP and MySQL with delete from users table where username is Kaylee, including success checks and error handling.
Welcome to the beginner-friendly PHP and MySQL course! This course is designed for those with little or no programming experience who are looking to learn the fundamentals of PHP web development. This course is beginner-friendly and will introduce you to the world of server-side scripting and the power of PHP. PHP and MySQL are two of the most widely used technologies for building dynamic and interactive websites and web applications.
PHP is a popular, easy-to-learn server-side scripting language that allows you to create dynamic web pages and interact with databases. It is the backbone of many popular content management systems such as WordPress and Joomla. MySQL is a widely-used, open-source relational database management system that will allow you to store and retrieve data for your PHP web applications. Together, these technologies will enable you to create robust and efficient web applications.
Throughout this course, you will learn how to use PHP to create and manipulate forms, validate user input, and interact with a MySQL database to store and retrieve data.
In addition to the basics, this course also covers advanced topics such as sessions and cookies, with a special focus on data sanitization and security and also using PDO (PHP Data Objects) for database access and working with MySQL.
With PDO and MySQL, you'll be able to create dynamic and interactive websites with real-world functionality.
The course includes hands-on projects. You will be creating a working form, a todolist application and an Employee Management System.
Whether you're just starting out in web development or looking to enhance your skills, this course has everything you need to succeed. We will go straight to the point with handy examples to get you quickly up to speed. By the end of the course, you'll be able to build robust, secure, and user-friendly websites using PHP. Don't wait, enroll now and start your PHP journey today!"