This post will show you how to search a PHP encrypted database. This is a follow up on the PHP encryption and decryption tutorials. Many have made the argument that once all the data is encrypted and stored that there is no way to query the database. However, you can query the database and I am going to show you how to do it in this lesson. If you are new to encrypting data in PHP please see our post BEST PHP ENCRYPTION DECRYPTION MYSQL TUTORIAL | PROACTIVE METHODS (a1websitepro.com)
The Problem of Searching a PHP Encrypted Database
You will need to know how to search your PHP encrypted database. For example, if you wanted to search for my name “Maximus” it would be impossible to do so directly in an encrypted database. This is the whole point of security. If you have thousands of entries, then to print it out on a page and look through it becomes cumbersome.
How To Search A PHP Encrypted Database
There are a few options you could do to search a PHP encrypted database. You could decrypt and export to a json or xml file then bring it into your application. However I am going to show you something simple and more secure.