In this lecture, we will create an username and password for our control panel. To do so, we will be
using INSERT INTO and MD5 functions of MySQL. If you are new to these concepts,
Please learn more about them before continuing.
So let's start coding.
Open up your terminal and connect your database service.
And use your database.
We will be inserting data into users table.
We have already created those tables in previous lesson, previous lessons.
So in order to insert data, we will be using insert into function since we are inserting data into
users table.
We are using users keyword here and we will be inserting data into ID, username and password columns.
And our values will be, since it's the first user, the id value will be one and the user name
will be admin and the password will be MD5 hash of
MD5 hash of changeme string.
I will change the password after the video.
So make sure that your password is complex enough, otherwise your control panel can be hacked.
And let's see our data by using select * from users query, as you can see, our
username and password is here.
So.
Open up your browser and go to
your login page again and try to login with valid credentials and you will be redirected to
index.php page.
As you can see, we are redirected to index.php page
So that's it for this lecture.
See you in the next one.