How to Insert Update Delete In Php Mysqli

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome to my another video tutorial in this video I'm gonna teach with you how you can insert update delete the record and PHP and masculine so I go to my iced Doc's folder and I create a folder and enter the folder name and I just want to take and drop the Florida editor don't sad and I will create a file index dot PHP then I'll write the basics index of HTML then I will download produced a file to design my registration file so I search on the disbarred State then I open the first link then I click on download button and also download button then I select location or path say start onward once you have downloaded the Poots Ted then white click it and extract her and I go to CSS folder and I will get boot steps for CSS file copy it and go to htdocs folder inside the trout folder I will create another folder and I said a folder name inside this folder I paste boots the file once you do that then I will include the CSS file would exist fall on my document link violation style sheet rs4 name my file name both step toward CSS then I'll check the bootstrap working or not so I use h3 and I use hello guys assign the class display display for and I will open this project on my browser localhost / grout okay it's fine right bye-bye just a minute I'd okay I needed close link tag so first of all I will design registration form so I write they're assigned a class container inside the container I write another day and that's in the class room inside the role I assign a class called lg6 inside this day I write another day and I send a class called inside the card I said class called titan' he said the car title is in distributed you know write the name registration form and th and after this form I mean do I assign a class card body inside the card body I write the form tag and I will assign the action and so dot php' anus and the method post inside this form I will use input fields and I saw the class font control and placeholder username and also we need to assign the name the name is very important to get the data found into text field copy that and paste two times and I change the type and also I placeholder name using email and change the name and final this edge user edge everything is perfect open your favorite browser and search or officiate okay so I need to display down card on the center so first I assigned a class on the body BG dot and I assigned the margin and auto means margin left and right at the margin top 5 + BG success then save it and then open Rosa kind of a the page okay no absolutely so nice but I want to use reading top and bottom three and first I said that and refresh the page okay now I want to include the button and also our bedding on the top in the bottom getting to sad that first I check it yeah it's fine so I copied that and best best we need to include the button okay and I use submit let us sign the Colossus like VTN BG n time D and we need to include the name submit right serve that and open the drawers I refer the page okay username email and eggs we need to create a database and also table so guys just a minute I will create a database and also database I curated database drought okay and I sent uh mm the cards and I seen the four columns first column is ID user ID user ID username user email user password user edge sorry those are watcher I assign the type of the watcher and assign the range 100 100 100 and first column I assigned the primary key identity which will generate the automatically number so said that our database name is cloud and our table name is record so we need to create a file say the file connection dot PHP and write the basic syntax of PHP and we need to create a variable and by the mile scale I connect method and pass for parameters localhost route that is blank for the your database name my database name is Crowell and I check the condition if connection not is stable then come into the if body and display the message connection connection error I use my skill i error method okay I'm not a sign that miss I'm internet that just I display the message now we need to create an insert dot PHP file to get the data from input text fields so pop that and create a file save the file write the basic syntax of PHP and use simple statement to use if set the underscore post if anyone user click on the button the button name is submit then who will comment but if body otherwise come into the else body in the ass body I'll use header function and I call location index dot PHP anyone user click on the button then who will come into the if body otherwise we will redirect with an extra is P so in the if body I get them first I assign the input in your third to check the in paddy fields tell underscore post first post name is Ned I check it name okay now you can see her and I assign the also on and Colin $30 for post second is email parties Tabby's H use two decades in the ass Stefan if anyone feels all empathy then display the message please follow in the planks in the ants body I will get the each data from input text fields so I assign that variable clear the variable and get the data from and protects me the first input X field name is name second is use the email those are variables you know guys and I get that now I get the H once you have get the data from and protect fields and assign the data in the variables then you can use a Curie the Qt is very simple use insert into your table name my table name is recourse then select the column the first column name is username username user email this is the second column name I do not assign the first column name because the first column name have a primary key identity which will generate automatically numbers so you need to assign the second third and fourth column name user edge then use values the values is use single quotation and the first variable you need to assign the common and second variable assign the common third variable once you do that then you need to create a variable like under any name I assign the result variable and use my skill I Curie method and pass two parameters the first parameter is connection variable and second is your QT variable we need to include connection file on this page because I have used theory and I help call the connection variable so you need to assign the connection file connection of PHP file this is a connection dot PHP file as you can see a connection rod laver once you do that then you need to write a statement and call it self variable if result variable is active then just put a message I want to read out with another page another page I will use location and you dot PHP page I want to read that little PHP in a squaddie I want to display the message it call your chili please check your chili why do we need to create our view dot PHP page and I want to display the message simple message I will use the success index of PHP then I just write that question male Val calm user okay this is a very simple open your favorite browser and select I mean search it i refresh it and enter the name I use Asif and I send the email app to Lockeford and I send the edge 27 and click to submit now please fill in the blanks why hmm just a minute name email edge just Chapman okay this is incorrect now okay sad that it's perfect okay go back officiate and Asif Asif web one two three twenty-seven okay now we have redirected with you dot PHP page it means we have successfully store that a card in the database so let's shake it okay now as you can see if user 1 user name user email an edge okay I want to store another record just a minute I change the name yes yes home and serve okay I want to destroy another record because I want to display those two card on the side it's like a limerick or 28 we have stored more than 30 cards get it Rico I want to display those record in the HTML tables so in the view dot PHP page so I go to my Moodle PHP page inside the blue dot PHP page I copied the basically complete called index dot PHP page and paste on her then I remove the form I mean form and also a heading tag and also I remove the basically called body and core title and inside this I write a view course so first of all we need to get the connection files so I use row file once connection dot PHP then you need to use by the Qt basically selects Tara from clout and you need to write the variable and call MySQL I qe+ parameter the first time it is connection second is curie variable once you do that then you need to create a table so in the inside the card there are either travel and TD sorry we need was a curator basically clear inside TR I call TD user ID those are manual data and username user you know use basically mm/h another sign in that class travel travel border okay said that and refer the page okay all right username our user user ID username user email and user h I want to increase the size I just write the call okay it's looking so nice though so I want to display the record okay after the TR RI the basics index of PHP inside the PHP tag I write the basically while loop and create a row variable and call my skill I fetch associate inside this you need to pass the result variable we have assigned the result variable on oppo then you need to get the data from database and assign the data in the variables so I use those are basically this is a basically database column name I will show you guys use arriv'd username user ml user edge we will use those column name to get the data from database and assign the data in the variables so first my variable name is user ID second is user name we need to change the column name whose name and use that email user email and use the edge user educate those are our local variables and those are database column names you need to write that term another sign after the brackets once you do that then I close I cut basically the steel brackets and closing PHP tag then I write that this is a closing tag on her okay then I use TR and TD after that TD I mean TR I arrived the basic syntax of PHP and close it I need to change I need to write the script record to kilos the basically a while loop body inside the TR I advised the this exam talks of PHP and I need to just ride the coaster main and called each variable user ID copy that and fast as best just need to change our variable names Oh Pete and finally caught that and best said that and open a browser refresh page 33 line number 33 where is the 33 long number fetch just a minute I checked my slack district from route connections result variable connection kill variable row variable my skill I fetch dissociate reserved variable everything is perfect called function my skill I affect associate and just a minute just a minute my skill I H associate what's problem now is just a much my skill I have fetch associate and okay okay so guys this is a my database name a database name is cloud and my devil name is record so I think everything is perfect okay now as you can see a one-two-three record available in the table I want to display the links to perform the operations like a little car and delete the record so I go to my quad editor and first I write the update and best test delete or edit and delete right then we need to create a TD and inside the TD I need to write anchor tag and raise link clothes inside the link ry the text edit right copy that fester and finalize delete we need to write the class I do not assign that class just I want to display the links okay adit adit edit and okay guys so we need to display them first we will discuss basically edit the record I want click on edit button then the record will display in D and protects fields so I go to my core editor and first I need to assign the link page I have a clear our page edit dot PHP then we need to create a get variable to get the link I mean get the ID I assigned that Christian mark sign and get ID variable this is a variable name you can write any name as you like then I will use basic syntax of PHP and I caught the first statement and I called user ID variable it means I can hover the mouse on the each record then the different numbers will appear on here I go to my just a minute i refresh it and then I hover the mouse on number one then you will see number one I just click on it I will show you this is a gate variable name and this is the number one record okay I go back and I click number two now this is a get variable and ID number two I click on add it this is a gate ID variable and this is a call number three so we will use gate variable to get the ID to display the specific record in the HTML form so we need to create a edit dot PHP patch up to that create a file save the file as you dot PHP inside the file I just want to copy the whole code in the inductor PHP page and paste there once you do that then you need to change the type I'm in pattern name update and also update and I change the basically registration update form in PHP so I want to display the specific record in the each input text field so we need to get the data from database so we need to write that the 600 of PHP and we need to fire the connection and we need to get the user ID you need to write the de'longhi scope get we will get the ID from the new dot PHP page using gate ID variable a copied up gate ID variable and passed here then we need to write the curie the curie is select static from the cards user underscore ID a care to a single quotation double quotation or dot soil and pasta user ID variable it will get a specific record it means i will click on number one then I will show number one record if I'm gonna click number two then I will show number to recover use result variable and call my still iqt the third pass two parameters fastest connection second is Q variable then you need to try the while loop to get the data from database and assign the data form far wherever's inside the loop body I go to my with our PHP page and copy the whole chord like username and I mean I will get the data from database and assign the data in the variables once you do that then I want to display that each data in the input text field so I go to my form section inside the form section first of all I change the action I will write the name of the updated PHP page I will keep it updated PHP page on later this time I want to display the data so after the name double portion I use value and a sign and use equal sign basic syntax of PHP and why the post at main and call the variable which will get the data from database right so I copy that and test her tester okay use a email use the edge okay said that and then open the browser after the pitch okay I hover the mouse on number one I click on number one - card right I'll see if I said web developer 27 okay I go back I click number two we all rose at gmail.com number to record I mean each record available in de update form I want to click on update then the record will update and display the updated record and that view dot PHP page so I go to my code editor we need to create an updated PHP page so click update dot PHP page and set the file that our PHP by the basic syntax of PHP and use the and we'll use a click on the button update button then come into the body otherwise we will redirect location sorry we need to use header function and vocation view dot PHP page any when user click on the I mean pattern then we welcome into the F body in the if body I will get the data from user ID first I get the user ID because user ID is very important to update the record okay so first I go to edit dot PHP page inside the edited PHP page I have assigned username user email and user H we need to assign the ID variable to get the specific ID from farm tech I mean from edit dot PHP page so we need to copy duck user ID variable and after the update or PHP page I will create a get variable I assign the ID variable and pass the this variable okay it will get this ID variable will get a specific user ID so we will use this variable to get the ID so I copied this variable and I use tolerance for get past the I'm in variable then I need to use basically get the data from database username I mean in pro text field telescope first name user email dollars for post email and all underscore user edge I'd tell underscore post H right once you do that then you need to write the Curie the Curie is very simple this QT variable update and the table name is records just a minute and then we need to basically just a minute we need to get I mean use the database column name the first column name is first I need to assign the set update record set the database column name first I use user name and use a kill sign single quotation the percolation drops on it and pass the first variable username after the single comma you need to fly the comma and second database column name is email single quotation double quotation door sign use their email but the single comma you need to write comma and third variable setup is column name is user edge some rotation of the quotation dot so I can't use a edge third variable after the single condition you need to try the where keyword and first column name first column first database column name the first column database column name is user ID and use equal sign single quotation of a quotation dot dot sign inside the dollar sign you need to pass user ID variable which will get the specific user ID like then you need by the result my scale IQ variable and positive parameter the first is connection the second is Curie variable we need to include the connection file profile once connection TV once you do that then I use F talents concert if the result is active as a variable is active then who will come in through that if body and I want to redirect with you dot PHP page so performing the whole operation the else body I want you to display the message please check your cutie they said that and let's check it I'll go back and refresh it I click on analysis and I change the depth 30 update now the record has been updated right now as you can see the record has been updated i chained are basically username so brahma stiff and a killer quartet programmer ass right I want to change this why hit H 30 far that mmm right and as you can see now the final step is I want to delete the record right so you need to use same process go to edit our PHP page and view dot PHP page that okay blue dot PHP page and copy the basically complete code with double commas and paste here and just change the page name and also get variable there we need to create a new dot PHP page copy that clear the file say take it out and use if this set talents were taped and even user click on the link okay I will show you there is a link mmm okay we need to are used I mean condition to del is active del variable is active mmm well then come into the F body and I want to just use Curie first I need to I just we delete from records where user ID this is the database column name and single partition double quotation drop outside inside this you need to user ID get the user ID song get variable we have assigned a get variable like Adele and pass this variable and use reserved past two parameters mysqli cheery connection and cutie very we need to include basically connection file require once connection dot PHP right now the next thing is I use if poor condition and write the result if everything is perfect then coming to the body and call location this is a I want to read up with you dot PHP page in the else body I want to just let a message please check your connection check your cutie okay everything is perfect so I want to check it professor and I hover the mouse on number one then you will see on here number one del underscore number one number two number three I want to do is number three record something is wrong okay something is wrong so I think in the from course where user ID chattels user ID result location we dot php' touch okay I check it guys just a minute I use Alice's statement and I call later location W dot PHP said that refresh it I want to delete the economic tree okay I think there is a problem don't let's go get help okay this is the problem Dell yeah just I'm gonna copy it and paste it okay I think everything is perfect said that refresh it leader call as you can see how the record has been deleted I need another record another record has been deleted so those are performance using PHP and MySQL I I have explained you everything you need to know and this project I hope you are understood as well thank you very much for watching please subscribe my channel for getting updates have a nice day guys
Info
Channel: OnlineITtuts Tutorials
Views: 75,120
Rating: undefined out of 5
Keywords: Insert Update Delete In Php Mysqli, How to Insert Update Delete In Php Mysqli, insert update delete in php using mysqli, crud in php mysqli, crud in php tutorial, OnlineITtuts Tutorials
Id: SlF1VNXHD1o
Channel Id: undefined
Length: 39min 53sec (2393 seconds)
Published: Wed Jun 20 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.