How to Select a Table from a MysQL Database Using PHP



PHP


In this tutorial, we will show how you can select a table from a MySQL database using PHP, so you can then display that table.

If you have a database comprised of many different tables, PHP has a SELECT function which allows you to select which table you want.

The format to do this is:

Below we give you a table, which is called Fruits (as it represents different types of fruits), which we have selected from a MySQL database:

Fruits