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...
we can execute a query that will list all tables in a specific database along with the disk space (size) of each. We can list all the tables along with each table size (disk space) by using a query. SELECT table_name AS Table, ROUND(((data_length + inde...