MySQl is very powerful language when we are working with database. We mainly use MySql to perform CRUD (Create, Read, Update and Delete ) operation but we can do more with MySql. In this post i will explain you how to make search in database from A – Z and how we can find first character or any name from database using MySql and PHP.


Connection to database using PHP

PHP is very simple and easy server side language to learn. We can make connection to database using php with simple connection function.

In above function we need to define three parameters first parameter is to define your host , Second  parameter is for Username and last parameter is for password. After creating connection we need to select database

Now connection and database is selected. Create table inside database and insert data or sample data given below.

Now we need to create a list from A – Z so user click on any alphabet and we make search in table for result.

Search in table for result

 Complete Code

Display all first character of name using MySql