
Learn to connect PHP applications to MySQL databases using procedural and object-oriented code, create databases and tables, and perform insert, select, update, and delete queries.
Set up a local PHP development environment with Apache and MySQL using Apache Friends, enabling localhost access and phpMyAdmin to manage databases.
Set up a local Apache and MySQL environment, verify phpMyAdmin access, then create a settings file with four DB connection variables (host, user, password, database) for a new database.
Establish a PHP database connection using mysqli_connect, organize credentials in a settings file, and handle connection errors for reliable database access.
Create a new database with a setup script, establish a connection, and run a create database query to name it, such as my test.
Create a table named courses with id as an auto-incrementing primary key and a title column of varchar(255); use phpMyAdmin to run the query and prepare for data insertion.
Insert data into the courses table with PHP by setting column values, executing the insert query, and verifying results before preparing for select queries.
Select all from the courses table, output each row id, title, and lessons to the page, and use where, limit, and order by to refine results, then close the connection.
Learn to delete rows from a database using delete from table where id, targeting with a unique id, and test the queries before moving to object oriented connections.
Connect to the database using an object-oriented PHP approach with the link object, using connect error to handle failures, and use Querrey to create databases and tables.
Explore an object-oriented PHP approach to creating a MySQL table with a proper connection object, executing a create table query for courses, and handling success or errors.
Explore inserting data into a MySQL database using an object-oriented PHP connection, including single and multi-query inserts into the courses table, with error handling and result checks.
Learn how to select content from a MySQL database in PHP, fetch results, and display course data using procedural and object-oriented queries.
Learn to delete a row from a MySQL database in PHP with the object oriented approach, updating the connection and removing the item with id 3.
PHP and MySQL together allow you to create amazing applications. Connecting your code to your database is what this course is all about. Learn how to add a database connection to your PHP application. Connecting a database is required by many applications and there are many ways to do this via PHP code.
Please note that this course does not cover the basics of PHP and basic knowledge of PHP is required as part of this course. It will not be covering PHP coding outside the scope of the course summary. Setting up your local server is optional and suggestions for a local machine setup and editor option are provided within the course.
This course covers writing PHP code in both procedural and object oriented coding to
Source code is included to get you started quickly. Examples and samples for both coding options.
Everything you need in one place, connect to MySQL its easy and can bring your application to the next level.
Taught by an instructor with over 18 years of PHP development experience.
I'm here to help you learn more about PHP and ready to answer any questions you may have. Join now and start creating MySQL queries in your PHP code today.