Hello, in this video, I'm going to show you how to delete data using a delete query. So deleting data would essentially delete even one row or multiple rows. So it's really simple, you first of all need to create a query is going to be equal to the connection and we're going to prepare a statement. And the query is literally DELETE FROM so the actual table, which would be this table here for users, users, and then you specify the actual, you know, sort of where condition type, let's say ID equals one. This will delete the one that has an ID of one. Because the column ID is unique and a primary key you will only ever delete one row in this instance.
So if I save that, and let me show you this is the latest database for reload now, arrows I know what I need to actually execute it. We read a few. So now if I was to reload this There you go, that one has now been deleted. But you can delete multiple roles as well. So imagine if you wanted to do it where the user name he called Anakin Skywalker. Then we could delete all of the animal Skywalker, all these duplicates, for example, so where it equals anything, go.
Okay. Now if I reload that, I think See, all of those have been deleted. So that's how you delete a row or multiple rows from your database using the Delete query. Really simple stuff. Obviously, always be careful when you're deleting stuff because you can't get it back unless you've got yourself server, your, you know your server provider set to actually backup on regular intervals. And that's usually an extra fabulous you have to pay for.
I recommend having something like that. But always be careful when you're deleting stuff. So that's it. Any questions, feel free to pop me a message and as usual, I look forward to seeing you in the next video.