0
1
00:00:04,250 --> 00:00:06,790
<v Volkan>In previous lecture we listed our books</v>
1

2
00:00:06,790 --> 00:00:09,950
and also details of our books, it's here.
2

3
00:00:09,950 --> 00:00:11,870
And in this lesson what I want to do,
3

4
00:00:11,870 --> 00:00:14,200
I want to make search in my database,
4

5
00:00:14,200 --> 00:00:16,410
but before that here, there is something wrong here
5

6
00:00:16,410 --> 00:00:20,630
it must be sort by, so We need to fix this problem,
6

7
00:00:20,630 --> 00:00:24,232
it is now short by, right. So let's find it.
7

8
00:00:24,232 --> 00:00:26,940
Actually first Control...
8

9
00:00:26,940 --> 00:00:28,510
F, okay?
9

10
00:00:28,510 --> 00:00:30,350
Short...
10

11
00:00:30,350 --> 00:00:31,210
is...
11

12
00:00:31,210 --> 00:00:34,550
Must be sort. Sort by, it's okay now.
12

13
00:00:34,550 --> 00:00:37,940
and let's go find to our...
13

14
00:00:37,940 --> 00:00:39,664
search button, it is...
14

15
00:00:39,664 --> 00:00:43,197
search button is here so what I need to do here
15

16
00:00:43,197 --> 00:00:45,723
I need to create here a command,
16

17
00:00:46,606 --> 00:00:50,440
property command is equal to self dot...
17

18
00:00:50,440 --> 00:00:51,520
Search...
18

19
00:00:55,090 --> 00:00:57,330
Search books, okay.
19

20
00:00:57,330 --> 00:00:58,777
And after that what I need going to do,
20

21
00:00:58,777 --> 00:01:02,030
I need to create this definition right.
21

22
00:01:02,030 --> 00:01:04,350
And before that let's also check our entry name.
22

23
00:01:04,350 --> 00:01:05,400
Our entry name...
23

24
00:01:06,500 --> 00:01:08,420
entry search right it's that one.
24

25
00:01:08,420 --> 00:01:12,270
So here, I come here and say
25

26
00:01:13,650 --> 00:01:16,800
def search books, okay.
26

27
00:01:16,800 --> 00:01:21,800
And here my key my word is, let's say value, value of search
27

28
00:01:22,180 --> 00:01:27,180
is equal to self dot entry, search, right?
28

29
00:01:27,290 --> 00:01:30,733
And dot get method, okay. And now what I need to do
29

30
00:01:30,733 --> 00:01:32,930
I need to say, search...
30

31
00:01:34,850 --> 00:01:39,013
is equal to cur, search, dot, execute.
31

32
00:01:40,170 --> 00:01:41,990
Actually we can also...
32

33
00:01:44,092 --> 00:01:46,890
create a query, but anyway it doesn't matter.
33

34
00:01:46,890 --> 00:01:48,970
Now we can also create our query here.
34

35
00:01:48,970 --> 00:01:51,780
Here, what I will say, I will say select...
35

36
00:01:52,940 --> 00:01:53,830
Star...
36

37
00:01:56,126 --> 00:02:00,200
from books, okay this is my table name, where...
37

38
00:02:04,580 --> 00:02:05,730
book name...
38

39
00:02:08,667 --> 00:02:12,460
like is capital can be, like.
39

40
00:02:12,460 --> 00:02:13,908
And here what I need to do I need
40

41
00:02:13,908 --> 00:02:15,860
to use question mark, okay?
41

42
00:02:15,860 --> 00:02:17,771
and after that here I will say,
42

43
00:02:17,771 --> 00:02:19,790
my value will be...
43

44
00:02:20,890 --> 00:02:24,030
here, comma,
44

45
00:02:24,030 --> 00:02:27,037
and I will say...
45

46
00:02:27,037 --> 00:02:29,220
single quotes,
46

47
00:02:29,220 --> 00:02:32,170
and percent symbol, okay?
47

48
00:02:32,170 --> 00:02:37,170
And again single quotes, sorry, we have single quotes here.
48

49
00:02:38,220 --> 00:02:40,530
And plus value...
49

50
00:02:44,490 --> 00:02:45,323
Okay?
50

51
00:02:45,323 --> 00:02:47,420
And after that here what I will do,
51

52
00:02:47,420 --> 00:02:52,401
I will say again plus single quotes and percent symbol, okay
52

53
00:02:52,401 --> 00:02:54,297
And after that what I need to do,
53

54
00:02:54,297 --> 00:02:56,597
again I need to use here,
54

55
00:02:56,597 --> 00:02:58,900
comma, okay.
55

56
00:02:58,900 --> 00:03:01,670
And after there I will say...
56

57
00:03:01,670 --> 00:03:04,080
fetch all, okay?
57

58
00:03:04,080 --> 00:03:06,270
And after that what I need to do now...
58

59
00:03:07,930 --> 00:03:10,340
Here, I will come and say let's,
59

60
00:03:10,340 --> 00:03:11,895
firstly if you want, let's print our search
60

61
00:03:11,895 --> 00:03:13,193
I will search.
61

62
00:03:16,087 --> 00:03:16,920
Search, okay?
62

63
00:03:16,920 --> 00:03:19,553
And let's run our application first.
63

64
00:03:21,750 --> 00:03:24,110
For example let's say origin okay.
64

65
00:03:24,110 --> 00:03:29,110
Origin and search as you see now it's here, origin.
65

66
00:03:29,370 --> 00:03:30,260
Alright.
66

67
00:03:30,260 --> 00:03:33,370
And we have only one result by the way.
67

68
00:03:33,370 --> 00:03:37,190
And if I run it again, let's find something else like...
68

69
00:03:40,433 --> 00:03:41,700
We can say here the, okay.
69

70
00:03:41,700 --> 00:03:45,750
Because two books have this key word, "the".
70

71
00:03:45,750 --> 00:03:49,270
And search, and as you seen now here
71

72
00:03:49,270 --> 00:03:53,525
our result is now, we have two records, right, from database
72

73
00:03:53,525 --> 00:03:56,410
The Da Vinci Code and also other one is
73

74
00:03:56,410 --> 00:03:58,920
The Power of Positive Energy, okay?
74

75
00:03:58,920 --> 00:04:02,180
So what I need to do now, here I will say...
75

76
00:04:05,237 --> 00:04:06,313
search dot.
76

77
00:04:06,313 --> 00:04:08,713
Firstly I need to delete my list box right.
77

78
00:04:10,395 --> 00:04:12,440
Self dot list box...
78

79
00:04:14,630 --> 00:04:18,070
List books sorry, list books dot delete
79

80
00:04:18,070 --> 00:04:21,403
and zero and until end.
80

81
00:04:23,260 --> 00:04:25,320
And after that here what I need to do,
81

82
00:04:25,320 --> 00:04:30,320
I will create a variable count is equal to zero, okay.
82

83
00:04:31,080 --> 00:04:33,980
And now I need to use for loop for...
83

84
00:04:33,980 --> 00:04:36,420
book in search
84

85
00:04:36,420 --> 00:04:38,210
I search query, okay.
85

86
00:04:38,210 --> 00:04:42,150
And here I will say self dot list books...
86

87
00:04:43,640 --> 00:04:45,200
dot insert.
87

88
00:04:45,200 --> 00:04:50,200
And I need to use count as an index and after that str...
88

89
00:04:52,800 --> 00:04:57,060
Again my book, zero this my ID, okay,
89

90
00:04:57,060 --> 00:05:01,660
and after that what I will say, plus...
90

91
00:05:01,660 --> 00:05:06,660
And I want to use dash and again, plus, book, one.
91

92
00:05:07,430 --> 00:05:09,710
Okay this is name of my book.
92

93
00:05:09,710 --> 00:05:11,900
Now if I run my application,
93

94
00:05:11,900 --> 00:05:14,043
and sorry after that what you need to do
94

95
00:05:14,043 --> 00:05:16,040
you need to also say here count...
95

96
00:05:17,220 --> 00:05:18,320
plus...
96

97
00:05:19,260 --> 00:05:20,610
equals one.
97

98
00:05:20,610 --> 00:05:23,970
Okay you need to raise our count, we need to increase it.
98

99
00:05:23,970 --> 00:05:26,670
And for next book okay,
99

100
00:05:26,670 --> 00:05:28,420
the first one is zero, okay, but for the next one
100

101
00:05:28,420 --> 00:05:30,440
you need to increase it and count
101

102
00:05:30,440 --> 00:05:32,052
it'll be here one two so on, okay.
102

103
00:05:32,052 --> 00:05:34,703
And if I run my application now.
103

104
00:05:36,610 --> 00:05:38,640
Let's say the, okay.
104

105
00:05:38,640 --> 00:05:40,530
We have two books because to records
105

106
00:05:40,530 --> 00:05:42,360
as you see now The Da Vinci Code is here
106

107
00:05:42,360 --> 00:05:44,270
The Power of Positive Energy is here.
107

108
00:05:44,270 --> 00:05:48,420
If I click you see details of my books is here,
108

109
00:05:48,420 --> 00:05:52,505
and all details of the other book is also here.
109

110
00:05:52,505 --> 00:05:54,120
For now that's all
110

111
00:05:54,120 --> 00:05:55,120
See you in the next.
