Querying a MySQL Database

So far we’ve created a MySQL database and tables, populated them with data, and added indexes to make them fast to search. Now it’s time to look at how these searches are performed, and the various commands and qualifiers available.

Select Clause PHP

The SELECT command is used to extract data from a table. Let’s now examine SELECT in more detail.
Basic Syntax :
SELECT something FROM tablename;

SELECT something FROM tablename;

The something can be an * (asterisk) as you saw before, which means “every column,” or you can choose to select only certain columns. For instance, Following Example shows how to select just the author and title and just the title and isbn.

SELECT author,title FROM classics;
SELECT title,isbn FROM classics;