
This is an introduction to the course letting you know what will be covered throughout the course.
In this lecture you will learn how to set up CodeAnywhere (if you decide to use it). You are also free to use your own development environment.
IMPORTANT: Please read carefully
I use Codeanywhere in this course. Since the initial recording of the course, the interface has changed and Visual Studio Code is used as the code editor (awesome!). As a result, things will look a bit different. I am therefore offering to SET UP YOUR CODEANYWHERE SERVER FOR YOU and help you get started if you are having issues. Just send me a private message.
The coding and files within the course are not affected in any way but the initial setup is slightly different and, obviously, the interface will look a bit different. I am in the middle of recording all videos again but this will take a few weeks. You are free to use any development environment that you are already using (if any). Otherwise, I highly recommend using CodeAnywhere to write your PHP code.
If you have never coded PHP before then you may not be aware that the code needs to be run by the server engine prior to being displayed on your browser as HTML. You therefore need to set up your server environment correctly. If you do not have experience of setting up a server environment then simply use CodeAnywhere.
Due to the huge number of possible platforms and editors I cannot offer support for third party development environments. However, I will happily support you if using CodeAnywhere as it is the editor I use throughout this course.
There are many additional benefits of using CodeAnywhere including:
there is a free 7 day trial if you would like to test the environment. If you do like it then you can get the paid version on an ongoing basis. Otherwise feel free to use any alternative PHP development environment.
it is cloud based so you can use any computer to login
if you are having any issues with code during the course you can share your code easily with me by inviting me as a collaborator onto your server (only if you wish)
if you need additional help with your server then I can log in and help (provided you are willing to allow me)
if you wish to upgrade CodeAnywhere to a paid account later then you can (otherwise just use the free version for 7 days or install a local version of Visual Studio Code and MAMP/XAMPP)
If you experience any issues with setting up your PHP for Beginners coding environment on CodeAnywhere then please let me know via a private message and I will happily help you out.
In this lesson, you will learn how to create a database table by importing a SQL file generated from generatedata.com.
In the resources section of this video you will find a downloadable file containing the SQL file should you wish to use it instead.
In this lesson we continue the idea of getting a quick win by retrieving records from the database and displaying them in the front end.
We go back to basics with phpMyAdmin and learn how to manually create a database table and populate it from within phpMyAdmin.
We also look at how a CSV export from a spreadsheet can be used to populate the database table.
In this task you will need to create a table for the teachers.
Take care when creating the fields and make sure you select the correct field type.
When uploading the CSV file remember which steps you need to take to ensure you do not include the header row.
This is the solution for TASK 1.
I think it is important for you to feel confident with this task before you move on to the next lesson.
In this lesson I review a few of the options in phpMyAdmin and show you how to update a record.
There are too many options, many of which are quite advanced, to cover in this beginners course. However, I go through some of the basic features.
We will be coming back to phpMyAdmin throughout the course.
In this lesson you will learn how to make a connection to the database and use a try catch block.
In this lesson we use a try catch block to pick up exceptions from the database config file.
In this lesson you will learn how to create a record
In this lesson you will learn how to read database records
In this lesson you will learn how to update database records
In this lesson you will learn how to delete a record from the database.
This task involves you creating a database and populating it with the books.csv data. Please see the resources area to download the books.csv file.
A full video solution is provided in the next lecture.
Good luck!
This is the solution to the book store task
In this lesson we start to integrate html with php.
We use Emmet to simplify the process of writing html code (see: https://docs.emmet.io/)
From the initial book list which looked quite ugly and difficult to read, we transform it into a little beauty!
This is just a pre-lecture note about the update to the fontawesome.com website.
In this lesson we consider what the client of the book store would need in terms of being able to edit the records. We therefore add a little edit icon using Font Awesome.
When we click on the edit icon we will need to send a query string to an edit file so that the record can be edited.
In this lesson we create the edit page and add the URL to the edit icon so that when the client clicks on an edit icon the id of the book is sent as a query string on the end of the url to the edit page.
We then pick up that query string and get the id and echo it to the screen to show that everything is working.
In this lesson we will populate the edit page with a database record.
In this lesson we look a little bit deeper at how we can fetch results from the database.
We consider the array content and what we really need to be able to view the record fields.
In this lesson we will use filter_var to provide some error trapping and validation of inputs.
In this lesson you will learn how to update a record via the HTML form
In this task you need to create a delete script to delete a record from the database
This is the solution to Task 3. You will learn how to delete a record from the database.
In this task you will need to create the form and script to INSERT a record into the database.
This is the solution to Task 4. I show you how to create a form that will allow the user to enter record details which are then sent to the database.
This is the complete code for the course in one single downloadable zip file
Welcome to PHP, PDO and MySQL for Beginners!
This course is intended for those who wish to develop their understanding and skills in PHP and MySQL in order to develop data driven websites.
Every line of code is explained as I teach. The lessons are kept short and to the point.
STUDENT REVIEW: "Patrick is an excellent, thorough and easy to understand teacher. I bought this course as soon as it was available because I was so impressed with his first course. Thank you Patrick!" 5 STARS
STUDENT REVIEW: "I learned a lot in this "close to real live" education. It was very helpful to get into connection with some important things close to PHP. By taking a look at bootstrap, emmet, SQL and little bit of CSS and other things was very helpful to get an overview of the most important tools and languages around PHP. I really love to listen to and learn from Patrick. He is giving very good and easy to understand comprehensive explanations, he is setting tasks that are a challenge but feasible and he is showing the solutions. By listening to all that and writing the code myself in the tasks I really learned a lot. Great Stuff !" 5 STARS
STUDENT REVIEW: "An amazing course. Very good for beginners." 5 STARS
The unique difference about my courses is that you are given exercises to complete after each section. This enables you to try what you have learnt with my full support. Students who have taken this course appreciate the level of clear explanation and strengthening of their skills.
The course has been developed following years of teaching students in a real classroom environment and watching and analysing their reactions to new concepts. Therefore, each lesson has been designed to quickly help you understand the processes involved in connecting to and actively using databases within websites.
At the end of the course you will be able to:
create a database using phpMyAdmin
use a SQL dump to create a MySQL database table and populate it
use a CSV file to populate a MySQL database table
change database user permissions using phpMyAdmin
connect to a MySQL database using a PDO connection
understand the acronym CRUD
create, read, update and delete records using phpMyAdmin
create, read, update and delete records using PHP
create an input form using HTML
create, read, update and delete records by using a HTML form and PHP
use Bootstrap to style the input form
use Font Awesome to add some icons for edit and delete actions
present database table records in a table and style it using Bootstrap
THE DEVELOPMENT ENVIRONMENT
IMPORTANT: Please read carefully
You are free to use ANY development environment including the one that you are already using (if any). In this course, I show you how to download and install Visual Studio Code and MAMP (both of which are FREE and available for Mac and Windows).
If you are unsure about which code editor option is best for you then I encourage you to contact me and I will be happy to discuss the options with you.
You can also follow this course using your own preferred code editor.
Once again, using Visual Studio Code with MAMP is OPTIONAL. You can use ANY suitable development environment of your choosing.
MY PROMISES TO YOU
As a registered teacher (yes, I teach in a real classroom every day), I strongly believe it is my job to ensure you feel totally supported when taking my classes. I therefore promise the following:
to respect you as a student and individual with your own learning needs
to be courteous and polite in our interactions
to answer your questions about the course content promptly
to fix any issues you may encounter with the lessons
to respond promptly to feedback
I really do look forward to welcoming you to this course. I am confident you will enjoy the approach of learning what each line of code actually means.
Join the course today.