Get number of deleted rows before Mysql Query Running

a few seconds read

If you looking for “How to get the number of rows about to get deleted.Please try small tricks to avoid unwanted data deletion.

You can use SELECT  to get the number of rows about to get deleted.

PHP Mysql

PHP Mysql Query

By this query we check  the number of the deleted row before running the delete query to avoid the unwanted records deletion.

For example yours delete query is:

Table Name :employee

Delete Query :

“DELETE FROM employee WHERE employee_country=’India'”

Now you can check total deleted data before query will run.Just replace the “SELECT * ” in place of “DELETE”.

“SELECT * FROM employee WHERE employee_country=’India'”

Facebook Twitter LinkedIn Telegram Whatsapp

Related Posts:

Below Mysql query is very useful to Get list of column name from table with its datatype. You can get list of all the tables name and all the fields count with help of this query. PHP Mysql Query In below query just change <–YoursDatabaseName–> to your d...
Frequently asked basic and advanced MySql Queries Interview Questions and Answers. PHP Mysql Query 1. What is MySQL?  MySQL is an open source RDBMS which is built, supported and distributed by MySQL (now acquired by Oracle). 2. What is the Differentiate betwee...
“How to Export MySQL data to Excel in PHP ?” This script will used to export data into .xls format from mysql database.You need to just copy this code and update database connection details. Below code will export mysql data into excel (.xls format) with ever...