People already pointed out some major flaws with this, but also an issue is that you should be doing a Mysql error check with each query you are doing. Maybe you have issues with the first couple of queries and then none with the later ones. You would then not see any of those errors. As well it would be better to do them all in one go so you don’t have to worry about half your deletes working. This also would help reduce the queries going to the database and make things quicker overall.
Another small point, your example seems to be related to items that might be for sale. Most likely you wouldn’t want to delete them as they might be attached to something else in the database (say an invoice) that might still need that information. I run into this a lot with our student programmers who have not quite grasped the interconnection between things in the database or the desire to be able to see things in the past that are no longer needed. In cases like that it is better to have an active/disabled column that you can change instead of deleting the whole item. Deletes are something rarely used by us normally only for linking tables.
And as a double emphasis, please add sanitization even in simple example code. This is something that a lot of people still don’t quite get because they never see it in the examples they look at and is one of the worst security risks you can have.