[Link] How to create, read, update and delete (CRUD) with PDO, MySQLi and MySQL the right way (prepared statements)
Mike Dalisay has written an excellent tutorial on the CORRECT USAGE of basic CRUD functions (create, read, update, delete) with PDO, mysqli and mysql. Please note that basic pure mysql_ functions are outdated for some years now and should be avoided! Only bloody amateurs use mysql_. This is an very valueable tutorial if you want to start with PDO (the correct way to do database requests!) or want to have a look on how to use mysqli correctly (using prepared statements). Take the time to read through this, it’s essential stuff for your daily work.
The tutorials contains videos, screenshots, copy&paste code examples and a really really good explaination.
Mike Dalisay – PHP and MySQL CRUD Tutorial for Beginners
I recommend other to use prepared statement or PDO to create crud operations. Using prepared satatement to create CRUD in MySQL and PHP (https://www.cloudways.com/blog/execute-crud-in-mysql-php/ ), same query can be executed multiple times with greater efficiency. This makes your website less vulnerable to sql injection as well.