Saturday, July 18, 2009

Searching a MySql database for a Value to find which tables contains it.

In my recent works, I needed to do a search for a some string value to find what are the tables contains that value. Although there are easy tools and methods which allows you to search for a value in a known field and known data table, I couldn't found a easy way to search for a value in a entire MySQL database. So i wrote this simple PHP script for accomplished that task. If somebody needs such functionality, they can use the script. Please change the database host, user name, password ( and database name ) according to your requirements.

This scripts helps to search a value in an entire mysql database. In main results page, it will displays the tables which contains the search value and what are the fields which contains the search value and number of occurences of the search value. By clicking on the number of results column value in the main results table, You can go to a page which displays the rows which contains the search value in relevant database table.

Download it from


No comments: