OK, teach yourself SQL is to big a topic for any post :-)However, although I don't know MySQL and PHP, I can probably give you some general SQL pointers.
1) To return a subset from a table, you need to USE a WHERE clause e.g SELECT * FROM FRUIT WHERE FRUIT_TYPE = "TROPICAL"
The above SQL will return all records from the table "FRUIT" where the column FRUIT_TYPE = "TROPICAL" (not "tropical" or "Tropical" since SQL is case-sensitive)
2) WHERE clauses can be concatenated and/or wild carded e.g SELECT * FROM FRUIT WHERE FRUIT_TYPE = "TROPICAL" AND FRUIT_COLOUR = "GR*"
Check what the wild card character is in MySQL because it can vary between different types of SQL
3)To sort returned results use the ORDER BY clause e.g. SELECT * FROM FRUIT WHERE FRUIT_TYPE = "TROPICAL" ORDER BY ORIGIN_COUNTRY
The above SQL will cause the returned results to be sorted by the contents of the ORIGIN_COUNTRY column in the FRUIT table.
These are the simplest forms of these functions and much more sophisticated constructs are available. I suggest you google for "basic SQL" which returns a number of good intros to SQL.
Like I said, the above a general SQL principles and I normally work with Oracle not MySQL. However, they should give you a hint as to where you need to look in the MySQL docs
Should I upgrade to Windows 10? 8 reasons why you should upgrade to Windows 10... and 2 why you…