Crud Operation in Php Using OOP (P-01)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome to another video tutorial in this video I'm gonna teach with you how he can perform the operations like insert update delete view using PHP mascara and also object-oriented programming language I will use hope our concept to perform those operations so I have designed this application I'm going to show with you working process of this application so first of all I'm gonna insert the record and then also open PHP myadmin and I'm gonna use PHP I'm gonna use PHP PHP PHP I'm gonna use save as you can see you guys data has been saved it this is already stored that I'm side or database so this is a view dot PHP page is you can see and inside this page have are two operations like edit the record delete the record so first I'm gonna delete I'm at the record and is update now the card has been updated right and this is a updated forecast I'm going to show with you the application database and also data and this is the users table and inside this table have a same record right as you can see now the last thing I'm gonna show with you - today the record just click on lid no record has been deleted I'm gonna click arcane delete everything is delete from all that I was like me check out right this is a complete and putty table so I'm gonna teach with you how you can design ended up the application using object-oriented programming language in PHP so first I'm gonna read over how and I'm going to show you how in download to step basically angles go to step CSS file to design the application process is very simple just a wait couple of seconds let me select the C and HD Sam HT talk and project cloud trout trout application set that download open the folder and then I wanna get the only CSS file bootstrap CSS file so remove this one and cut people to step Darcy's file a kink at piston remove this false color and also you need to create a folder within I'm UPSI cells you need to move this file inside this phone now the next thing you need to make open your holiday term and just take and drop the file inside your code editor I'm gonna show with you just a minute typical days details of things now drag and drop think I'll check out okay so CSS folder and CSS file so let's start to write the code so first I'm gonna write the index dot PHP file and then I'll write the basic syntax of HTML just a note alright HTML basic syntax and I'm going to use trout patient in PHP using now the next thing we need to include the CSS length inside CSS folder have a CSS file like bootstrap Dursleys so first thing we need to design the registration forms so first I'm gonna sign the class b g dot inside the body tag right and I'll create a couple of tails and then I will assign the colossus just a minute one two three four five six right so first I'm gonna send the class container second one is like whoa third one is a-- call lg6 means larger scheme and the form will be appeared in the six size the two are there are twelve columns inside our complete whole page using Buddhistic classes so now the next thing i mean a sign class card and class heart title right so I think I need to cut that and rest it right this is a card tighter and this is a card boarding right just gonna die away that last one is a class photo right and said car title I'm gonna use H to sign up form and say the body and I'll form action I'll leave the action and use method post and use input type text and then first plus no I first assign the placeholder first name and class form control leave this one and also I'm going to use margin bottom to make a space between first and second input text field right second one type is text and this is a last name lost copy that pastor third one is also text this is a username username and fourth Manila you know you want to use you are on into text field you can do then Marcus I will design this one type application I just share you how you can use language to perform those operations so last one is a user email and everything is perfect no not a perfect I cut the form closing fan tag right and paste inside our card footer there because I will use but take sir Soyuz class BT and BT and success and also send the name PTM this person said that and that's it love throughout I mean I searched my project what is my project man OOP trout that right this is our did this is the whole forum now I want to display this form of the center so I just used marginal time inside call as g6 cell and refer that right and also I want to change title to filter right I want to make the space between browser and our form so go to where is the car this one card and I sent the class margin top five right now the next thing we need to create a database basically I have already made that abyss with the name of crowd I will treat your table when it implies and we need to make five columns so for available inside our form and five one is your ID number that will help you to generate that unique number so first one is the ID type is an integer and we need to also use a tournament energy the second one is the first name last name username and also enough so I'm going to change the types you are cha-cha 255 255 255 255 solve that and our database has been heated soy our table has been treated now the next thing we need to create a connection right so I open my folder project folder and I will get it a folder like conflict right inside config file a folder I'm gonna create a file DB convict the fish pee inside this file first I'm gonna buy the basic syntax PHP and then I'll get a class with same name DB conflict fill right inside this class I will create a connection between our database and our project so first I'm going to call public function DBMS coconut I also make a variable public connection right this is a convention inside the connection function DB connect function I'm going to call down at this and call connection value about this one then I mean use my skill I and the connect function we need to pass their amateur localhost null and for to another database name trout right and I'm going to use if statement if mask you'll I that'll connect connect error this one function if our connection is a stable then I mean not stable so I'm just let a message collection so this is a very simple I'm going to check that our connection working or not so outside of this class and then I just be new config DB conflict this is a database column I mean a class name this one and I'm going to call call DB - no did we connect function serve that on let's check it know what is man convict or / DB common sake of HP everything is a keenya you can't see that at all but i change the username like this one if at that access denied file user this is the error so we need to use root so we have made our database and also and make a connection between our database and also our programming language now the next thing I'm going to eat another file inside the config file operations are please inside this file class operations and set this file I will use functions that will help you to perform the operations like insert update delete view right so first of all we need to make a function to strew the car inside our database so I'm gonna write public function is to underscore the prod this is another function that will help you to store the record inside that data is right inside that such I believe it is say the underscore post beaten on the school side if anyone user will click on the button set and I'm gonna just leave a message watching right this is very simple now I'm gonna call this function where I call this function guy's first thing you need to include operations dot PHP file inside the DB config file I'm gonna call five buns of patience no conflict just element DP not operation star P right now the next thing we need to also use config furthermore I check that again because basically no I just use DB so operations shows our PHP and we need to include this file inside our index dot PHP files so I go to a pole first I'm going to call fire once the console type PHP and we need to make a object of the BB config file inside DB control file have a function like connect PBS and inside this file here are also operations dot PHP once you made the object of the db2 config file then you will be able to access the operations dot PHP file but you need to also make an object of this file I'm going to show with you so first thing I mean a car make object of operations dot PP file so then they stop this one if you can't figure out please rewrite this one way okay so I'm gonna call DV check true new this is a variable name this is a new keyword and I'm gonna call operations so I I'm gonna display I'll use this one functions right so I go true below and after the header tag I'm going to power this if index of PHP echo no DB and inside the D we have a function what is function is torque on this one this one function right as you can see I am able to see this one function this is an object of the operations dot PHP file and inside this file have a function with the name of historical right why I have used requirements config file debited config file and said this index dot PHP one because inside a Lipitor config file have of already included the file operations dot PHP you just need to make a object of the specific class inside the specific class haver functions and also the neighbors you can call them I'll teach with you step atoms so first thing I'm going to check that it's working or not okay here is a some problem the first one problem is a hewa DB dot config file line number 3 DB tour config file line number till this one so I'm gonna use this way leave it at home feet right also the operation star PEP alright this one so first I'm gonna check that how this operations but if you just undone guys on set config file operations completion fine sir let's see it now could be bitter conflict without config required ones filed opening yeah just another guys I check that so let you call config country operation story sure as far as available why I seen this one problem no just a minute guys I using dot and also I think I need to integrate this one on here but I'm going to change that to use DT conflict because I will use Curie's and also I'll use this function to connect the database with our application and also our program so think okay everything is perfect guys as you can see so I'm going to use something something something something and just use working right we are able to use this way to get the data form input text base so I'm going to remove this file and one more thing we need to do we need to go on db2 config file and inside that we need to call first when you to Karl constructor public function in the scholastic construct and said that I'm gonna call all of this to be connected function means if I will call this class with another K another file and we will create an object then the constructor will be automatically loaded and our database will be connected so I will use this and also I cut that and paste over here now the next thing we need to make a function inside this class this function will help you to get the data from in protect fear and we don't need to assign the two parameters like a connection and key we just assigned the function I'm going to show it here when I use public function check and pass the parameter a right we call the return variable and Cal - Cal I realistic string this - and connection variable right this is our first parameter now the second parameter we need to pass a variable we will call this function on here to get the data from in pro text field I will teach with you how it anyway now the next thing you need to call return keyword and return the variable like this one do you want to change the name you can do there said that now the next thing you need to go on operation start PHP file inside that you need to make a variable first name and you just call first you need to make our object of the DB config file so I'm going to call DV Chiltern U and DV config file right once you met then you are able to access this variable I mean this object inside this table our function and also variable with the name of connection you will use that to perform the operations like instead of the delete so I'm gonna call DB and this one object inside the object and the call to get function what is function and check I'm just gonna die check out the function one more thing we need to do we need to use global baby inside this function because this object available outside of the class so and said that have a function check inside check function however parameter we need to pass parameters wanna call dollar underscore post single quotation we need to create the data from input text bill so I go to index dot PHP file copy the first name tester I'm gonna leave that this is the first ready copy that there's basic test now the second one is the last copy that test third one is a username copy test fourth one is a user email copy and paste you need to change the variable name last name username and final is a user in mark you want to change that you can either use now the next thing we need to also create a function outside of this function I'm going to call function that will find that function will help you to store the return I'm going to show you a key function and record we need to pass for a parameter e [Music] do you want to change the name you can do that and set this function we need to first write global DB object and we need to write the QD here is insert into mm is employees and column them in the first name last name username and I think using them I'll check that hmm employees structure last one is a simple email so those are database column we'll use parentheses single quotation comma single quotation commas and quotation we need to pass the parameter which available and set this function e B comma C right now the next thing you need to call result and talk B become of this what you know I'm gonna call my SQLite Sheree and said that we need to pass to Pamela DB this DB common collection second on is acute available then I'm going to call if result variable is the actor to return to you at the wise return false this is our function this function I'm going to call inside of this function so enough if download this then search the car function is active we need to pass for parameter so copy the first one variable phase there , second one variable best air third one variable past their fourth one variable that's bad right this is your function if this function is working fine then I'm gonna display that message cut the call they're dead rolls nice and applause alert Allah such sex I just do that yeah I saved that deep abyss said I just use that right a dive is over we tied with I'm gonna display the same message but change a lot a lot danger in the record doesn't I just use felt and also I'm gonna sign the validation simple validation I don't remember that but I try that and this is a pretty field validation so I think I need to check that calm it default in this one check it just a minute my why I seen this one problem hmm just do that I use config folder name right config inside just no time yes I think config up all that fish I think it should work not working fine so immediately starts on again let's check it now game undefined method check this one method I have designed this one method and side if config file so why check function doesn't work on here the local TV checked on this post first name just turn that guy that check that okay guys so the problem is introduced extend keyword and we need to include DB dog conflict the config file this one file because we need to use this one function connection so we need to also include the extent and class name so I have tried that show it you move your card has been said I already stole the cart and said this one table right let's check it now I think I need to last one of them buddy I think this video is too long in the next video I'm going to teach with you how you can display the record right so thank you very much for watching see you in the next lecture
Info
Channel: OnlineITtuts Tutorials
Views: 16,169
Rating: undefined out of 5
Keywords: Crud Operation in Php Using OOP, crud in php oop, insert update delete in php using classes, oop php crud, oop php crud operation using mysqli, oop php crud tutorial, OnlineITtuts Tutorials
Id: KH3Pe-2shL8
Channel Id: undefined
Length: 32min 10sec (1930 seconds)
Published: Sun Oct 06 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.