1
00:00:00,420 --> 00:00:06,480
Now we are going to write our script to the Sibley database content, which is basically essential reading

2
00:00:06,960 --> 00:00:10,810
and different values that we did pass using ESB.

3
00:00:11,370 --> 00:00:16,350
So let's create another PSP file in the Public Assemble folder.

4
00:00:18,440 --> 00:00:22,220
So click here and let's name it, ESB.

5
00:00:24,230 --> 00:00:26,900
Data dot hp.

6
00:00:29,610 --> 00:00:31,800
After creating the file, click Create.

7
00:00:32,790 --> 00:00:33,930
Now we have it here.

8
00:00:33,970 --> 00:00:34,830
USB data.

9
00:00:35,130 --> 00:00:41,430
What you need to do is simply click it and click it to start editing your code.

10
00:00:41,850 --> 00:00:45,930
Now, let's save our previous code and create a new file.

11
00:00:47,370 --> 00:00:49,940
Make sure that the syntax is PSP.

12
00:00:51,930 --> 00:00:59,970
Now, let's start writing, the first thing that you need to do is provide the additional basic chords

13
00:00:59,970 --> 00:01:10,150
so you can get it simple chords and as you can see, this is the main line that you can write, you

14
00:01:10,210 --> 00:01:10,320
know?

15
00:01:11,520 --> 00:01:13,080
So you can simply comedies.

16
00:01:13,770 --> 00:01:23,640
I will give you that source code and I provide links to download it and just copy from three schools.

17
00:01:24,720 --> 00:01:29,210
And paste, this is basically a simple chords.

18
00:01:29,250 --> 00:01:31,980
And here we have the body inside the body.

19
00:01:32,070 --> 00:01:34,660
We are going to create a record.

20
00:01:36,420 --> 00:01:45,510
So like PSB and now we need to start writing our code and it will be very similar to our previous court.

21
00:01:45,510 --> 00:01:46,950
So let's move these two lines.

22
00:01:48,000 --> 00:01:51,150
We need first to copy this information.

23
00:01:54,030 --> 00:02:01,380
The server name, which is localhost, the database name, database, user name, database, password,

24
00:02:02,160 --> 00:02:13,290
and let's say the codes, let's call it the ISP data the supplier OK, now that we since we have this

25
00:02:13,290 --> 00:02:18,030
code, we can't change again the syntax to PSP.

26
00:02:18,150 --> 00:02:22,980
I think that it did change it automatically to us all because we wrote a simple code.

27
00:02:23,340 --> 00:02:25,350
Now we can move to Patch B again.

28
00:02:25,950 --> 00:02:30,840
Now, once you are done with, I think, your server name, database, name, username and password,

29
00:02:31,350 --> 00:02:35,400
you need to create a connection and check it again.

30
00:02:35,550 --> 00:02:41,340
We did that in this code, so you can simply copy this create connection.

31
00:02:42,380 --> 00:02:43,820
And burst to tears.

32
00:02:44,490 --> 00:02:49,040
Now the connection further to apparent connection failed if you entered any of this information.

33
00:02:51,230 --> 00:02:58,610
After that, we need to create a secure all variable and pass along the values.

34
00:02:59,390 --> 00:03:01,910
And to do that, we can't simply.

35
00:03:02,850 --> 00:03:03,780
By the following.

36
00:03:06,270 --> 00:03:12,900
We write it that way here, but we were not different, we're here right now.

37
00:03:14,070 --> 00:03:18,180
Ask you all, then they will sign here.

38
00:03:18,180 --> 00:03:19,710
You need to write, select.

39
00:03:21,870 --> 00:03:22,230
I'd.

40
00:03:24,280 --> 00:03:25,090
Sensor

41
00:03:27,520 --> 00:03:28,060
data.

42
00:03:30,540 --> 00:03:39,360
Location data value one, value two, value three.

43
00:03:41,610 --> 00:03:42,660
And the reading time.

44
00:03:43,920 --> 00:03:51,660
These are basically the values that we want to grab from our database and find the database table that

45
00:03:51,660 --> 00:03:53,280
you need to read the data from.

46
00:03:53,400 --> 00:03:54,120
So from.

47
00:03:57,400 --> 00:04:00,580
And now you need to ride the table now.

48
00:04:00,640 --> 00:04:02,020
So let's go back here.

49
00:04:03,190 --> 00:04:07,060
Our table name is your speed data.

50
00:04:07,690 --> 00:04:15,730
So Kobe ISP data, go back and talk to your ISP data now, right?

51
00:04:15,730 --> 00:04:23,620
Order to order the data by I.D. and adequate or OK.

52
00:04:24,460 --> 00:04:29,920
Now this line is basically calling the idea from the database that's called ISP data.

53
00:04:30,250 --> 00:04:36,400
It's calling it since all data location data value one, Value two, value three and reading time from

54
00:04:36,400 --> 00:04:46,280
this database table and it's all done and the values by already starting from the what sounds like basically

55
00:04:46,280 --> 00:04:51,940
the phone number one and moving on to number two, three, four, five and more.

56
00:04:52,120 --> 00:05:00,250
Now, after doing that, we can equal the values we need to create a table to display data and without

57
00:05:00,250 --> 00:05:05,020
going into details of that Jamal coding.

58
00:05:05,290 --> 00:05:12,070
Since this is not an simple or BHP coding course, you can simply call my code on.

59
00:05:12,070 --> 00:05:15,040
This code is basically creating a table.

60
00:05:16,180 --> 00:05:25,430
As you can see, it will has ID sensor data, location data value one value provide a three and timestamp.

61
00:05:25,450 --> 00:05:29,500
This would be the name of the columns, and we will have all of these columns.

62
00:05:29,740 --> 00:05:32,980
As you can see, the salesperson would be five on the sill.

63
00:05:33,010 --> 00:05:34,270
Padding would be five.

64
00:05:34,630 --> 00:05:40,330
It's basically the space between cells and in vertically and horizontally.

65
00:05:40,870 --> 00:05:45,520
Now, after creating the table, we need to start parsing values to this table.

66
00:05:46,120 --> 00:05:53,440
And to do so, we need first to make sure that we have a connection to the database and call things

67
00:05:53,440 --> 00:05:53,950
by ID.

68
00:05:55,600 --> 00:06:00,820
Now to do that, what you need to do is basically use this code.

69
00:06:00,850 --> 00:06:10,570
Now, if the result of the connection is through, then go and call the I.D. and assign it to the ideal

70
00:06:11,320 --> 00:06:16,810
call the sensor data and assigned to the sensor, call the location data and assigned to the location

71
00:06:17,170 --> 00:06:22,450
and call the values and assign them each to a different variable and BHP.

72
00:06:22,900 --> 00:06:30,430
Now the next step will be to equal these values, and we can't simply do that by using this code.

73
00:06:31,510 --> 00:06:38,620
We are going to equal each of the values that we did receive from the table until this table that we

74
00:06:38,620 --> 00:06:39,760
have created here.

75
00:06:40,420 --> 00:06:48,520
So it will print out the Real ID that all sensor that that location data that will value one, two three

76
00:06:48,520 --> 00:06:49,490
and the reading time.

77
00:06:50,830 --> 00:06:57,520
Now, after doing all of this, we need to make sure that we are closing the connection, the BHP connection.

78
00:06:57,820 --> 00:07:00,070
So connection clause.

79
00:07:00,490 --> 00:07:04,600
This is the end tag for our PSP code, which is basically here.

80
00:07:05,140 --> 00:07:07,600
We open it here and we close to.

81
00:07:09,870 --> 00:07:19,290
Now, after doing that, we need to make sure also to right the table that we created a table so we

82
00:07:19,290 --> 00:07:21,840
can simply this thug.

83
00:07:24,650 --> 00:07:34,940
Here on this one floors, the tables tag that we opened here and this area, as you can see, this is

84
00:07:34,940 --> 00:07:36,760
the opening of the table tag.

85
00:07:38,210 --> 00:07:39,680
This is the closing.

86
00:07:40,250 --> 00:07:46,940
Now this is our code and I'm going to provide the code for you and this lecture resources so that you

87
00:07:46,940 --> 00:07:47,510
can use it.

88
00:07:47,900 --> 00:07:55,220
Just make sure that the server name, the database name and the username and password to what you have

89
00:07:55,620 --> 00:07:56,510
your website.

90
00:07:56,720 --> 00:07:57,800
Now select all.

91
00:07:59,530 --> 00:08:01,900
Kobe, the Cold War here.

92
00:08:03,340 --> 00:08:08,350
To your file manager, paste the code, click save and close.

93
00:08:09,530 --> 00:08:10,790
Now you are done.

94
00:08:13,050 --> 00:08:21,180
Now, if you try to access this code using very similar link, just like we did our previous example

95
00:08:22,740 --> 00:08:26,250
and we'll call you speed data, it's called the speed data.

96
00:08:31,870 --> 00:08:32,370
OK, yes.

97
00:08:33,290 --> 00:08:33,860
Not all.

98
00:08:35,870 --> 00:08:39,800
Now, as you can see, we are receiving an error line 20.

99
00:08:40,460 --> 00:08:41,680
Let's check for the error.

100
00:08:44,720 --> 00:08:45,050
OK.

101
00:08:45,080 --> 00:08:52,460
As you can see here and our code line 20, there's a problem which is basically we didn't in this line

102
00:08:52,490 --> 00:08:53,510
using a semicolon.

103
00:08:53,960 --> 00:08:55,460
So I had a simple column here.

104
00:08:55,580 --> 00:08:56,420
Copy the code.

105
00:08:57,680 --> 00:08:59,810
Go back edit tier.

106
00:09:02,040 --> 00:09:04,080
Don't what I provide you with the correct codes.

107
00:09:05,200 --> 00:09:06,970
Now, check if there is any other error.

108
00:09:07,220 --> 00:09:15,100
OK, we have a problem with constructing connection line 14, as you can see, connection failed.

109
00:09:15,400 --> 00:09:16,690
This was expected.

110
00:09:17,020 --> 00:09:24,760
I already told you that when you edit your database name, this is not the database name that's here.

111
00:09:25,780 --> 00:09:34,480
As you can see, this is our database name, so you need to copy this database name and based it on

112
00:09:34,480 --> 00:09:35,080
your records.

113
00:09:36,320 --> 00:09:39,050
It has a speed that which is the name that we did choose.

114
00:09:39,380 --> 00:09:42,110
But they usually add I.D. before that.

115
00:09:44,930 --> 00:09:45,340
OK.

116
00:09:45,650 --> 00:09:46,130
Let me.

117
00:09:48,860 --> 00:09:49,290
So.

118
00:09:49,730 --> 00:09:57,830
OK, now this is the name of our database, but they added their own ID for protection now for their

119
00:09:57,830 --> 00:09:58,480
username.

120
00:09:58,610 --> 00:10:00,500
It's usually the same case.

121
00:10:01,250 --> 00:10:04,970
Now let's check the use of name for this database.

122
00:10:04,970 --> 00:10:07,070
As you can see, this is the Database ID.

123
00:10:12,670 --> 00:10:16,150
And it has this table, it's called SB data.

124
00:10:16,180 --> 00:10:17,560
So the table name is correct.

125
00:10:17,980 --> 00:10:20,410
We don't have to change it now.

126
00:10:21,170 --> 00:10:25,810
Now, usually you have to add the same prefix for those other names.

127
00:10:25,810 --> 00:10:28,780
So we will cope with this and we will base that here.

128
00:10:29,710 --> 00:10:35,200
As you can see, now we have the idea, then the user name and let's go the code.

129
00:10:36,710 --> 00:10:37,820
Let's put it this.

130
00:10:40,570 --> 00:10:43,480
No, we can base that here safe and close.

131
00:10:45,570 --> 00:10:46,940
Few refresh the page.

132
00:10:50,950 --> 00:10:51,910
OK, just go back.

133
00:10:54,760 --> 00:10:56,680
Based save and close.

134
00:10:59,670 --> 00:11:06,240
As you can see, the ads and Soledad are location data value and value to value three and the time stamp.

135
00:11:06,750 --> 00:11:10,500
So our page is working just fine and this page.

136
00:11:12,490 --> 00:11:14,680
The first one also needs to be modified.

137
00:11:15,220 --> 00:11:17,020
We need to edit these three lines.

138
00:11:18,500 --> 00:11:20,000
Let's copy them from here.

139
00:11:22,990 --> 00:11:25,870
And this our original code, which is this one.

140
00:11:27,970 --> 00:11:36,040
And let's face them here, the database is something that at the base name need to be changed.

141
00:11:36,610 --> 00:11:39,640
Now save and close and you are good to go.

142
00:11:40,660 --> 00:11:47,740
Now, if you don't like to go and write the code yourself, you can simply copy our code and adjust

143
00:11:47,740 --> 00:11:47,890
it.

144
00:11:47,890 --> 00:11:53,020
Did the database and the username and password, and you are good to go.

145
00:11:53,050 --> 00:11:55,470
You can add more values and more variables.

146
00:11:55,480 --> 00:11:56,320
It's easy.

147
00:11:56,560 --> 00:12:06,550
You can simply add more values here using these lines and calling them using this line.

148
00:12:07,540 --> 00:12:13,030
So depending on your project or what you are trying to achieve, you can simply edit all of the squad

149
00:12:13,360 --> 00:12:17,320
to fit your needs if you have any question about any line of code.

150
00:12:17,530 --> 00:12:18,460
I'm here to help you.

151
00:12:18,490 --> 00:12:20,860
Again, this is not Apache or national calls.

152
00:12:20,890 --> 00:12:26,290
That's why I didn't go into details of the BHP Coding or Oshiomole coding.

153
00:12:26,620 --> 00:12:32,110
You can simply copy and paste our code and provide it for you and the results of the lecture.

154
00:12:32,980 --> 00:12:33,850
That's it for now.

155
00:12:34,030 --> 00:12:36,130
This is Ashraf from educational engineering team.
