Hello and welcome to this new lesson and this lesson, you will learn how to prepare to use a secure
database after signing up for a hosting account and setting up your domain name.
You can log in, just like we explained in the previous lesson.
Do you see panel or the similar dashboard?
After that, you need to follow my steps to create your database, username, password and your actual
table.
Now, let's first create a database and a user.
The first step is go to the tools section and select database manager.
As you can see, this is the database manager.
Just click new database, and here you need to enter your database name, database, user name and database
passport.
The first step that we need to do is choose your database name in our exam, but it will be ISP data
because we are handling, yes, P32 data.
Then we need to choose our password and our username.
So let's call them now.
I usually prefer choosing the database.
Use our name wisely and make it relevant.
Now our database username will be ESB board.
And you should enter your password here.
I will enter my bus home.
And you should write it down.
OK, but you need to make sure that you are using an uppercase letter and that your password is at least
12 character long and include no special characters.
So you can create that password or choose a random one.
As you can see, it will create one for you.
And you should take this information and save them.
And art, not politics, bad.
So here's not bad.
What you need to do is copy their username bursted, copy the.
Creating this database name, username and password.
That's it now click Create after copying this information.
OK, I don't want to save.
OK, now here's our database and now it's creating the database, so you should wait a minute or two.
That's the base element is one gigabyte.
You kind of create up to 100 table.
We only need one table and this is more than enough again for testing.
You can create two databases using the free hosting.
So I think it's a very good way to start this thing.
Shouldn't take long.
Now you can use localhost as a connection hostname.
And you can copy this information and place them in the note that you created earlier.
OK, now that we created this, the base, what you need to do is create the basketball table, click
here and go to HP my admin.
You can treat us a base or change a password or see the statistics from these two lines.
Just click phpMyAdmin.
And you will be redirected to this window.
This is the PSP, my administer very famous interface to control your database and create tables, delete
tables, create queries and other stuff.
Now, creating that skill base is the second step after creating your database and username.
What you need to do is go to the left side of this database, as you can see, and this will be your
database name.
Now, usually we did name it speed data, but they don't give you, let's say, access to this name,
so they add an I.D. before it.
So this is our database name.
Now you need to click it.
And once you click it, you have access to a database.
You need to go and click on the Ask tab.
This assault top will help us create our table and make sure we have open the database that you have
created.
Then click the built up.
If you haven't selected this database and click the top, it will take you to a new or general database
that you don't have control over if you don't follow these exact steps and run the school query.
You might create a table in the wrong database now to create that query.
A query is basically in billions of codes that you execute using this window.
You will paste them here, and once you click go, it will execute this query.
And this query will create the columns of our table and will create a new table for us with the name
that we do choose now to create that query.
You need to do the following looking newswoman.
The first step is right, create and as you can see, it's recognizing and choose stable table, then
sensor data or any other thing, you can't simply write this or ISP data.
Then you need to open and close to parentheses.
Now you need to write your query in between.
Now this will write the ISP data, which is basically creating a new table and naming it ISP data.
The next step will be is create the columns inside this table.
The first step is creating the idea column.
It's a it's a very common one that will be end.
And let's make it six now to be unsigned.
So like unsigned and so I auto increment.
We need it to auto increment.
We don't need to enter it manually and choose the primary key.
So it would be the primary care for our table.
This is a school, uh, database query.
So if you are not familiar with it, it's OK.
You can just copy and paste the code that I will provide for you and the resource of the lecture of
this section.
So no worries.
If you don't understand what I'm doing at this point now, I will paste the lines and then I will explain
them to you so that we won't waste time creating a school.
Next, we we need to create, let's say, value one.
And we make it far character.
Let's give it our first.
And make sure that it's recognized as not not okay.
Now this needs to be 13, not 10 and unsigned here, has a headline underneath it because, OK, let's
make this 10 because we misspelled it, OK?
And sign.
Signed.
OK.
Now everything's OK, now, let's move on.
We need to create other variables as well.
The second one is called value to a third one.
We can call it value three, depending on how many values we need to create.
We can create other values as well as we go with this code.
Now the next step will be.
Adding a timestamp, so let's add the reading time and make a time stamp default and choose current
time.
Stand on update, call on time stamp.
This one makes sure that we have a column that will put in the time at which these values were received.
Now, the next step is creating other variables, if we if we need, we can create a variable and call
it sensor, so it will be sensor data.
And it will be very variable character.
And let's give it a value of 10 or let's make it 30 and make sure that it's not lost.
We can't commit the same.
And based it here to create another variable and let's call it location data.
OK.
Location data variable shot Thursday, not null.
That's it.
Now let's review what we have done here.
We created that table and named it Yes, B data.
You can change this name.
We created an I.D. which will auto increment.
It's basically the idea of the table.
It will be one two three four five and will keep increasing.
It's the primary key that we are going to use to access any of these values.
Now we have created a character named since data and other character named location data.
We created value one two three to pass other values.
If we want, we can leave them to be zeros or we can pass data.
So these are basically variable creation.
Now here we are, creating a timestamp whenever we create or send a nuisance or data.
It will print out the time at which this sense of data was sent.
That's it for this lesson.
Thanks for watching.
This is Ashraf from educational engineering team.
Now, before moving on, we need to click the goal button to create this table, and it will take some
minutes, as you can see, my car returned, an empty result resulted, which is zero.
And as you can see now, this is our database and this is our table.
If you clicked once on your table, you can see that you have I.D. sensor data, location data value
one, value two, value three and reading time.
So that's it.
This is our table and these are all columns.
If you gave this matches and you got this, this result, it means that you have done everything correctly.
If you have any problem or if you faced any problem, please do ask you on a board and we have to help
you.
This is Ashraf from educational engineering team.