How to Select Specific Columns from a MySQL Table Using PHP



PHP


In this tutorial, we will show how you can select individual columns of a MySQL table using PHP.

A table may be composed of many columns. However, when displaying the table, we can selectively choose which columns we want shown. We do not have to display all the columns of a table. PHP has a SELECT function which allows us to choose exactly which columns we want shown.

We will show now how to use this SELECT function to display the columns you want shown, which may be all the columns or just certain specific ones.

How to Select All of the Columns of a MySQL Table Using PHP

Below we will give you a table, which shows all of the columns which make up a MySQL table.

Fruits