Wednesday, 4 April 2018

Relational Tables lecture -15


hey as what's going on is clever taking and in this very we're going to be
learning how to data into my the skill database which has many to many
relational tables so this is what the basic syntax(Dallas Website Development) it looks like for
inserting so like innovating and doing data into my school tables so for the
insert we have answered into keywords followed by a table name and said the
around brackets who have columns spirit in common than we have a
keyboard called values and inside the round break we have values separated
by Hama and make sure to always in close your values into single quotes when
writing the code and right so the valley one is going to go and say call
them one and valley to is going to go and say column to and you can have as
many columns of valleys as you one next up his select and we have so I could
followed by a star if you want us like all the record from the so we have a
work called from a table named keyword was and then the column name equals
the value in closing single quotes and you can also have as many columns if you
want by and in then with a and keyword and then following that by color
named eagles value in closing the single quotes next what we have an update
table myself cured and whatever called me you want to have [UM] so you set
the valley of the column named equal to a new value in a cause that in a single
clothes and you can also have as many cans as you want by separating them by
common so you full of that by cannot a column and I'm not a value and then
you have where she worried and column and he calls value in a closing single
close to they share my school knows which exact columns to try to update how
do we have the elite delete from table name were column equals value and if
you in this part here so you could just right do it from a table is going to
india we all the records from your table so that's basically my ask also index
and that's all we're going to need for this video so what we're going to be
doing here is we're going to be inserting data which we're going to be
scraping from met movie data was [NOISE] calm and we're going to be in
sitting all the data in our database which we have created in the previous
video with many to many relational tables in it now the kind of a tricky
part is going to be inserting the data inside of these many to many with
tables and the way we're going to be doing this is inserting the movie I'd
as you can see all these three tables have movies and it also has directors
an idea which corresponds to the main primary key of the people's which movies
is linked to so for the directors has directors stars has starred idea and
join us have started our genres and the way the tricky part is knowing which

the movie is associated which you with which director and what movies associated
with a star and which movie associated with words john around and for that
we're going to be using a special function I cold my school I insert idea
which gets the last key of the movie which has been inserted into the
database so that how are we going to know which movie is associated with
which I'd because we're going to be getting the movie good which has been
inserted last so well if you guys don't have this do have just gone ahead and
go to quite a common click on this article here and I've been it I ask you
well source code down here had just copied the whole [SMACK] and you can go to
the stream I am in and one or databases go out to create the data was called
movies had created and then go to ask you well and just space the whole thing
there and quick so that way all the tables will be created and if you go to
movies database so you can see that all the tables are there so you're going
to need that and also going I need them the bees a scrape in the script
which we've created any other you know as well if you don't have that no
problem go to clay we're taking calm once again and click on this article
called was creating using page and I've included all the source code there
so just copy this whole source code and I become and to you pace this code
inside and you feel called scrape on the score I and be that PHP and later
on you're going to be able to include in your other file which we're going
to be used to insert data into my school database and when you just be
cared this so the first of all I want to show you guys what we're going to
be a

Andre expressions php lecture- 14

hey guys were going on is to keep and in this lecture, we're going to be using a
regular expressions as part of a stem out just head up this Lecture is going
to be more advanced so i'm going to be moving a lot faster than you visual
so go and review this rage expressions(Dallas Website Development) cheese seater which my other very Andre expressions if you're not very fa miliar whether before watching this
video i was going had and get started so in this video we're going to be an
out I am a website which is an anomaly database and it's going to be using a
website called as one one dotcom to how struggle expressions against the
strength to make sure where matching them correctly and i've also decided to
have all the code to because otherwise would take many hours to show this
video so just to keep things short time was going to be explaining what
always called means so the first thing i like to do when matching a constant
from a website like this is to identify does sir reach stream from wish to
to match the content from so the sea al here is just showing a bunch of
movies that were released in the year or two thousand and i'm starting my
surgeon page one so you have all these elements like the title the year in
description director and stars and boats and draws and the image name so
we're going to be imagine all this content now the problem is here i'm going
to be using brain which all function which means we're going to be match and
all the elements at the same time now if i go to the later page for example
page seventy six is going to be a miss in a lot of that content so that
makes it a little bit more tricky because we can just match all the elements
individually we're going to have to measure block of elements for example
here we're going to have to match the moving on time genre and the eye
mediating at the same time and and check if any of those elements or empty
and if they are which is going to set the area value to an empty string so
let's look at the code now and all this is going to make sense hopefully so
first thing i'm doing is i'm loading up their ~~~~~~~ seventy six of the
surgeries walls and a story everything inside the result variable i'm also
creating a new era do these make and i'm just making in a [NOISE] so the
first matches i mention a movie title so this is a regular expression here
and i'm going to go ahead and piece that i go expression inside the right so
I aging and die and a search for this little string here inside of the
search results for our page source going to go a place source and I'm
going to search for that so since we're all in the last be here [COUGH]
seventy say this and who are matching this part of the regime it's shown

fifty results which means all the movies the photo movies that are showing
up on the page is you can see is showing up fifty results and this his old
has been mashed fifty times so that means it's a reliable way to match the
an actual title so that's why using this street this regen expression so if i
the place to actually i'm out here you can see that it's in fact capturing
there's a group one which means is going to store inside of our under a tree
one and his capture in the actual bulli tidal so you can see you're under a
the regular expression I have the little text then instead of the tt and this
the number I have a dog star question mark which means is just going to capture
anything so anything that's there is going to capture it at the numbers
going to change that's why have used the regular expression in this way
then I have the regular little text and then I was that you're flying break
here because there is a new line and then up captures everything that's
between the tags inside the basically using the same thing as a dot
starting question mark and captured it using them around records and that
creates the capture of the movie title ~~~~~~~ so another woman have made
sure that they're at your expression of works was actually go had a great are
movies named just to see that the fact matching all the titles and in fact
it is there's fourteen I know this is the ark stars with zero so there's so
elements and it's matching all the titles so now we're ready to Milan to the
next one which is a year and here's a Reagan expression for the year I'm
going to copy that inside the relics engine

php regular expressions (Lecture- 13)


what's going on guys is quick and in this lecture, we're going to learn a PHP
regular expressions(Dallas website Development)  so this is eighty cheated afraid here and I'm going to refer to it about this video and if you guys want a dollar a full resolution
of this image I have an included bank and inscriptions of this Lecture so if
you like to download to go and so so first of all live let's go to a website
called one on one and this is an also website that I would just discover
where you can practice regular expressions and rail expressions you can
think of them as basically wildcards on steroids so there are just patterns
to imagine a text and it's really useful if you're a web jeweler in the
one so I've matched some content on websites you can easily do cell with
regular expressions as well as mentioned any other content and also so for
the test or in I've included this pestering and the description of this
video as well and this is just a bunch of so a text that I've found where we
can you use the sex to practice using regular expressions on so I'm just
going to refer to this key cheat we're going to go over some of these these
quantifies care to classes groups and the ranges medicare is as well as
flags so we're going to go over all this just of and I'm going to explain
what most of these things mean so it was go had just started here so the man
which is any characters so if we simply could dot here it's going to match
all the characters on here and if I put star is going to which all the
things together so basically what the start is just to zero or more so in
this case if we put any character full followed by a zero and more this is
something that matches basically all the content so if you have a web said
or the other content placing a dot and a star heart will match anything and
he's probably they see something like this which is a wildcard dot and a
star followed by the for example when if I open up in north at here and you
go flying low then you get a sea down here and the types documents this is
the exactly the as the gray expression that's down here which is a start and
they die followed by the tea which means it's going to match [UH] files
within the text and there's another one of the years which basically says
match any extension at all and the star [UM] is exactly what that means
match anything so all right so that's how you match anything and let's see
here so please just means one there are more so that has to be something to
be matched where he starts you can match nothing or more that the question
mark is when things get a little interesting ok soul let me show you the
difference between the two so if I wanted to match these strong tags like


for example, if you have that if you have the constant website and for some
the reason you want a national HTML takes here is do you might do you might want
to do this right so who have this is what is called this is called the
greedy quantify fire because what will do here is you'll start with their
little [SMACK] angle bracket here and then you what you do when is basically
you're expecting to match all the content and then and then basically you
try to match this strong tack here but instead, this thing is greedy so is
going to go he had and match all the thing until it sees the adding angle
bracket here and that's what it's called green tea because they will match
will consume all the content in between the heavy this single bracket and
the single bracket here and if you wanted to make it a lazy your credit you
simply put a question mark your so now you can see that is matching the
asian my legs like we wanted them to and it's also doing that here so that's
the difference between greedy and deal

php variable hendley in function (Lecture -12)


hey guys equipment taking and in this Lecture, we're going to cover each the
data tapes and variable Hendley in function so and pitch be variable that it
is can be broken down three different categories scale or compose in a
special [NOISE] so the scale or as a single unit of the data and this
enclosed variables like the string which is text entire which is a whole number
flowed which is a fractional (Dallas Website Development)number and bully in which is a zero or a one
and it could also be represented as truth for one hour of false for a zero
next, we got composite which is an error an object and the or a basically
holds multiple values like you see here separate it from the common and the
object refers to the instance of the class so if we have a class claimed
the movie, for example, we can then say object because of your key and then the class
and that will create the object instance of that class so that's how we
create an object data type finally have a special and under special we have
a no which is basically means nothing or no valley at all and I'm not a one
is a resource which can hold special values like database connections open
files etc so these are the most common genotypes you get to encounter and teach
I now let's actually create some of these variables and that we can play
around with them so the first one time get any flying is a string variable
and so this is just going to be information about a matrix smelly I think
it's a good way to demonstrate all kinds of different [a COUGH] that a types
and teach me so this one is it going to flow and we find some was true
[UH] ~~~~~~~ and they're not going to create a more on and this one is going
to be associative or a and it's going to have actor names and the rules
the played in the movie and so I was going to put a couple of game and year
more beers for the end the that's enough so that is going to be our
associative and then today is going to be a rate that I'm going to create a
classroom you leave I create an object main tricks use and they knew the keyword
followed by the class lane which is a movie and that's can create the object
the instance of the class and it is defined in our world ~~~~~~~ and finally
[SMACK] is defined a resource and this one is going to refer to the open
file [a COUGH] going to specify the directory where this text while is located
can be any x files so and so this one is going to become a resource now
let's go ahead and covers some of the variable handling functions and the
reason I want to show you this is because there's you want to have variable
functions or variable having functions and Picchu which give you all kinds
of the information about data types and other information about the

variables and as you can see the first ones to get the type and it does exactly
what it says I guess I did a type of the variable now we have is said which
checks if the variable has been initializing on said destroys variable and
then we can just down well these this little teach either table here and
just check out all these other variables and play around with audio variables
that we have just defined but I'm going to create a loop now and I'm going
to who's get die variable to get the information about all the variables
that we have just created to get the data type but before I do that I'm
actually going to define a new very people and is going to hold all these
variables in it are using it rains so I'm going to find a variable and data
and then I'm going to say a rape and I'm just going to put all these
variable names inside of this range you now we're going to use a for loop
to look through all these variables inside of the data rate and I'm going to
use a get type function today to type ii of these variables of a soulless
creative for loop

php Lecture -11(Loop)


hey guys what's going out and square ticking and in this lecture, we're going
to learn about the beach for if loop(Dallas Website Development) the for each loop is used to look through and associate embrace so inside the break is here we have our so she to a
follow that by the going as and then we have our Niki which we can start
inside of a key variable full so that by the rocket operator and then the
risky value which we can story people called value now the key and value
variables can be named anything as long as you remember that this one refers
to the and that this one refers to the risk of out for you and just to
review this is what they're so she to a very looks like the key made with
refer to them in this example and the value variable would refer to the key


 the value which is twenty-three so that's the syntax of the for each flip now
the loop is going to end when the final key valley Paris it's so in our
the example here one german forty-two key valley there has been reached the loop
is going to end [NOISE] that's it for the syntax now let me show you a
a practical example I'm going to go ahead and create a new era here and of
animals and always going to be is by having animal names along with this
sounds those animal meaning those the more make so I'm going to create from
bad as [UM] ~~~~~~~ [COUGH] lawyers [UM] of ads some biennials care [COUGH]
health and hunger and culture [SMACK] was streamed the animal named here is
the key and the area value is the sound that this animal makes so I'm going
to go ahead and looked through the animals a now [UH] if you can see I made
my variables name and sound because it makes sense inside of our animals we
will have the animal name and this is what the names are referring to its
referring to their the key of the area and the sound is your for into the
valley of the rain so if I these two here and I use a space that can cat age
you together and then at the and I'm going to use the art make it look nice
or this is exactly was going to print out they're going to print out the
animal name and then space and the sound which the animal makes so as you
can see here there or is expected we're looking through their so she too
marry and it springs now at the art and the arrow value now I'm an all turn
as a way to write this would be as follows you can just use the associate
of a raw name and since who have access to the key this whole give us the
valley of the right and so now we have all the valley is not a way to write
this is to completely avoid this part and if we wanted to just print out the
arrow values who can do so in this way as well so this the same exact thing
as before so that's it for this example and now I want to show you something

else I want to show you how to money my area valleys by a reference so for
an example he found that renamed numbers and was going to keep the short and
put find numbers and year and then I looked through this area numbers are in
the short version because only need values were going to print out this radio
the most and the numbers if all the name and so right now has just printing
out there a and we have a key we have a value have a key you have a valley
so you can see that the all the valley as one two three four five now if we
wanted to directly modify those valleys here's what we can do and this is
called dietary valleys by the reference he would simply put the emperor sense
and from the air key and then we can say something like numbers equals i
mean number eagles I'm very times to and that would modify the three
a valley is so now all the all the valleys inside of the area would be doubled
so if I print out the area down here now

Tuesday, 3 April 2018

php -expression ( Lecture-10 )


hey guys what's going on is clever sticky and in this Lecture, we're going to
learn about this piece which statement [NOISE] so this is the basics in
texts of the switch statement to have a cure switch followed by the expression
inside the around records and between the curly brackets we have here it's
the case followed by the valley to enter Collins and break for by the semicolon
so what this means is if the expression of valleys to zero so then we want to
following cold dessicated and then we end the execution with a cure break if
we don't use the cured break after code (Dallas Website Development) then all the following cases
where also be evaluating it and the code will also be executed and I'll give
you an example of how that works a little bit later now the default cured it
will be executed if none of the other this matches so if our expression
will value to for example five then that code goal be executed so it is i
wanted to use break if you don't want all the following cases to be as luck
and the switch statement can be written and an alternative form like so so
instead of early brackets, we can use a column and instead of the ending
currently bracket we can also use and switch followed by the semicolon so
the switch statements index for you and now let's go ahead and I create a
little script to see how warps and practice [NOISE] so I'm just going to
create and our folk animals and I'm just going to put three animals and it
can a dog and duck and then I'm going to use the switch statement and for
the expression I'm going to put in our [a COUGH] and then I'm going to use
area and the or a trend function to pick out a random key from there and so
at this point king randomly take out cad Dugard duck and first the value
which we're going to get so we're going to write case I had colony coal now
so I'm just going to put in this sounds with the animals will make in for
cases which are a dog and dog ok for the documenting put echo with and final
we can forget to break that and place duck from enough with a is the break
and that's a basic program and I'm going to go ahead and running no and i
refreshed the page keeps refreshing and so as you can see randomly puts out
different animals sounds based on the can a kind of random art and value
which has been text out from the rain so that's a basic as an example of the
switch statement now let me show you a for example if we added the default
you're here and we get to say something like any model why did around for your
life so the good idea to run for your life we haven't an animal and here i
would put something like wants [UM] or and now if-if not of the other cases
had the magic so if it's not a and it's not a dog duck it's not a dog then


the default cases executed which are monster, in that case, I know animal
detected around for your life his executed and if we keep a hidden random is
you can see it keeps selecting at once in a while randomly so that's how the
default works and so now (Dallas Website Development)I want to show you an example if we simply don't
use breaks and it's going to give you I'm going to pick create a very boy
named speed I'm going to save sixty-five and so this is going to be like a
car example where we're going to be speeding so I'm going to see the switch
speeding and then I am I going to type all of that I have all these taped up
already but basically is going to give you a different message based on what
kind of same speed you have here so in a case in sixty-five and the age which
is the valley right now we're going to say you're going the speed limit
response.

php ( variable leacture-7)

what's up everybody this is quivered taking and this we're going to learn
about beach the sessions what our peach piece sessions well it's a way to
information across multiple pages and in phd to this information in sessions
is stored inside variable named on their score session it's a global
variable so by cookies where the information has stored on the users
computer and and text file sessions in sessions that information is stored
inside a global variable(Dallas Website Development) so i for their here named sessions and i'm going to
create a new file and i'm going to name it one that ph the way we start
session and b c use using a function sessions right at this point the global
variable on the core session becomes available so we can now set our session
valley is so we can today for example and you can treat this session you can
think of the session global era global variable has an era so we can said
the new named gene called username and said into a value and also set of
some other one [COUGH] what i'm going to do here in named role and at this
point let me just use my function to print out the iran and a better way and
i'm going to say pre are session to print out the rate and i'm going to open
it and as you can see the being variable rate has been printed out and
everything is working is expected now we can also say on this which session
variables had been set because the be hard to go and so on this page we're
setting our session variables now in order for us to check at the session is
working on other pages i'm going to create an a page and the gang came into
and i knew that each and i'm going to create html link i think into that
page the that with two of the game and on this page want every page you have
to their you're going to be access in your session variables and you also
have to use the function stations starred otherwise you're not going to have
access to that global session variable and at this and the information is
going to be available to us on this page as well so contest that out by
printing out there session or a and i'm going to go ahead and run one the
page me now which is the first page where we're setting that sessions
variables section very well have been set and if i got to to that pc as you
can see that session keys and values are still available because well what
we have successfully set the session and now we're access in them on the
second page so that how sessions work and that's a simple is that now we can
also modify session variables for example i can save session his name
because these a reality i can say said antinori username and then we can
print recession again that's what happens and i'm going to go ahead and 
 

open up one that they speak with on the link and now the you can see our original
values as well as the new valley so that's how you might have fire session
variables easy and let's see here lastly if you want to and the session you
use a function called session this underscore destroyed at this point our
social bees troy so if i around this file we need to that says can see this
session keys are not available in a more because we have destroyed [SMACK]
and and if i go back to one which is where we are setting our session
variables and then got a page too then all of our tease valleys have become
available(Dallas Website Development) so by using session destroy you're destroyed the session and raise
the session the re as well so that's how sessions work if you guys found
this useful please like sharon saw scribe and i'll see next time clever
taking out