How to Insert, Update And Delete Data From PHP mySQL DataBase In Flutter

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi this video we're gonna take a look at how to insert data to our database how to update data a database allows you to get data from a database we have already taken a look at how to connect up an online server as well as local cooks I'll do the link to those videos in the description so in the previous videos we use a key to be get to make this connection however in this video I'm gonna use HTTP POST to be inserts updates and it's a beta or the as you can see this is from the previous tutorial then of other this fluid selection button which takes us to a new page then in this page I have this again these two text fields with username and password and then it says button update button and begin its button so they'll walk you through what's up done again so this from our previous video and I'll put this floating action button here in this floating action button I have a child we get this icon and then pull your presence I'm going to navigate to this class insects updates deletes and I need to Cupertino page browse and you can see how I've added arrow tag to the floating action button this tag is optional but I think it's worth mentioning since most often people get to the top of those readings when you try to use one floating action button in the list view or several types in one cycle page so each fruits in action but so must have a unique hero attack however if it's just one in a think you can leave it but I mean we are two or more enough to create them but you get ready don't do these things what Sophia you just add one floating action button you intend to add whatever one then you have to give each one in your native tongue but this without your by the way and then as you have my up bar Rutherford at a local host and then what we did for the previous tutorial this is set up dates believes method is this class and then this class habits comfort but I'm up top I also have two decks close this one for the username input and then this one for password the textual takes a controller the difficult rule that is a text editing controller and have specified this up here as you can see this is a text editing controller and then what I'm doing here I'm just taking the text in this is the name control and then putting it into this username email so what about you input in this texture to be put into this viable and then I get a text out of this then assign it to a scramble and I'm damned same for the password I put super manatees hint of username password below there we have these three muscles once what is cellphone for updates at the 140 leads so without much ado let's go into our workspace folder then create PHP files for this say update and giving okay so in here I'm gonna go into my WW direct cream remember I said if you're on the X out he also be tasty dogs come into this folder then these are the two files we had from the previous videos I'm gonna go ahead and create three other fouls one 487 one from updates and the other for delete ok so I'm gonna play notes part then I'm gonna open a closed PHP tags I'm gonna save this now save it's here I like to save so that you can see we have it a I'm gonna go ahead and create a Adam false okay so now you can see I have this additional browse deletes updates PHP files so I'm gonna go back into the shell stick your code as you can see mine is it's four and a half that's in here beside these tags is the forward to do is to add our connection that speech before I'm gonna say require connection that PHP a little fallible to do our gonna pick the data from this box and this box will let us send them into a database so I'm gonna provide the data anytime the request is being named to the database and to do that I'm gonna create two variables one for the username we do the work for password username allah underscore post so am i said at the governance Pharrell never gonna use 82d first instead of baguette I'm seeing you so we're gonna provide is you name attribute no I'm making love good enough laptop I'm gonna go ahead and create a level of stability okay so mind you they're gonna provide this you never get this passed he loves retina button we are assigning them to this barbuso thank I use that here the next I'm gonna make a verbal to hood if my ear said query so you just leveled it before I'm gonna call it query basically virtually I'm gonna say into after this worth to provide the name of our database table in our case is our database and this article in I'm gonna put that here and I'm gonna specify the columns out he said is he - I'm gonna say Fidel what do you say five years column then body [Music] to specify the values want to be saved of the same values so our values I'm gonna come from EA they're gonna give strength I'm gonna say it single coat double coat then dots got little put our variable in between these dots so then just to help put our barber here tada the bamboo nail is not sticking as strange instead the first one is gravity but ahead and I'm gonna make it days I mean come on I'm gonna copy the same same then list around us blue give let's develop quits around it lift it up later belly as we did earlier to get us a collection let's prepare so what if they want they equally SP okay and then now we are down to find a quota as a key things I'm gonna scale it's me as a cubit okay so this was a kids are very the world I don't always say aku gives them good will septic data okay so just a bigger Cup we attach our collection of PHP file and then here will be graded through elbows to hold the input from Alpha Tau and then we live this visit its length to add to these columns and then these values which are these variables which will provide you know how boil it in a post request but preparing how query here they were educated here after that we're displaying this back to lay love that so I said I'll see you later let's go out we use it we get CA this HTTP GET takes you are MP days I'm gonna put it method we said let's get together yourself then last video I'm gonna make a strange thing you are never gonna make the first request to and remember this URL can get it from our database by coming to this test localhost you can see we have our first year but never go ahead and openings so this will the railroad doesn't place the localhost which one is the reserve to to when I using an algorithm data oh it's a Kalitta's IP address ethernet physical device this departs true to these files I'm gonna specify insides bigger and speech view so this is V del Y del rho omega first request to when I come to her village I don't make it wearable and say oh wait HTTP don't this tell Don I'm gonna use first and you can see it takes you are love the headers as before and learn the body this body is when I will put the verbose we declared in our PHP file so that is bearable to be inserted into the BIOS and a pitch before for the URL I'm gonna say UI and good food and then are you are me for the headaches I'm gonna say except application X last juice on a spirit area then the body is important so this body is also am I'm gonna put this here then provide the Bravo's in a pitch be found so the first one is this you name what they use I mean by this particular one name better kinase we're gonna provide it here and then what well we'll just send it through it can be whatever but then we please our text editing modulus values and then the next one will be and then finish theta so what I'm going to do instead of this data just provide this username here and then the password as well okay so once this is done online if the response no correct response body which will be put to JSON decode plus body so when I'm done only to bring this rest body okay so I'm to test this I'm gonna copy this into all the way down to our inserted the police here little sippie's a strong little back you know database you can see we have these items hello hi what's your name and then for the body we have these as well I'm going to go ahead and provide some name I'll hit this with safe now see down here we have accepted data which means we've has really been able to instead Anita I'm gonna go back to like database button here a little refresh and you can see we have this new one and us one I'm gonna hit it don't say that get that done well refresh this okay so you can see we have tracking again hidden feature now I'm gonna go ahead and update the time or detainees okay so far updates like they are gonna be needing collection of PHP I'm gonna be Linda quality as well you just gonna copy this since it's gonna be something similar instead Judas to beneath it so they're all your friends actually likes me also gonna go ahead and copy this to my boss but if so here there were different splice here other than that everything remains the same so here I'm gonna say update the world world updates also updates our table and our table image let's just want to set be heading to like we did before off to escape disco officials going to set the heading to is a new the body to pass the bleeding alright taking new one so I'm trying to resultant updates this level the back to lane of death I'm just gonna copy this is close of the stuff Oh baby sing and then make changes to updates may take them further you are alone the dynamic different costs we are interested in a new file so this time I will be interested in updates deterrence PHP I'll go to the middle comedies and we fix it to my updates method today you should be able to update this Google 6 update and you can see defeated so that was a problem here actually I could delete a button this doesn't delete anyway updates rather but in this doesn't change the results anyway we're gonna go back to our browser refresh base then you can see now successfully been able to update this to what was in the text field so the last I know the list will be this delete that's all and to do that we're gonna come here at my collection of PHP file take the Bible from a query to thermopolium for execution is a key to my query then display this resource ones that I tell how do you need a sofa luckily others delete from a start well I did because what to do the route ID one so hopefully with you to delete this hello how are you back in named of that I'm gonna go ahead and copy this again from little Cody's he needs me that now wouldn't believe the medium this body here I'm gonna go ahead and comment discount so I'm globally because here we know using those variables as we did for here we are using them here and here also we're gonna be leaving this delete data of PHP this page so I'm gonna provide that for the URL then I think we are set to go I'm gonna copy nice then hit the delete button so if I see we tape this item let's go back to our little games we still have it here hello Hawaii let's refresh and I can see our item is ID one is going okay so it is gonna be hit when in Sedona but if I wanted us to see some time that's why I ended up opening to distill the process which would equate to repeat over and over I don't know if we don't get it fill feature about leadership Darrell on how to call it a flatter after your Carlos also an online server and also if you between your 306 data from your server or from the locals use your flat aha so hopefully you understand this so just a quick you will have created an API for fun fact now leave the link in the description in case you may need it best to play around in your flat back out in the next video in the next video the direct take a look at how to insert a picture into your database so they'll get for this tool feel free to like and subscribe to my channel thank you
Info
Channel: Norbert Aberor
Views: 11,566
Rating: undefined out of 5
Keywords: how to connect flutter to localhost, Flutter php mysql, flutter, flutter database, flutter http request, flutter localhost, fetch data from localhost, insert update delete from sql database in flutter flutter sql Insert into Database, flutter sql Delete from Database, flutter sql Update in Database, flutter http post, flutter with mysql and php crud operation part 2, flutter tutorial for beginners, flutter with mysql and php crud operation, flutter tutorial
Id: 6peELG29UVs
Channel Id: undefined
Length: 18min 35sec (1115 seconds)
Published: Fri May 10 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.