Skip to content
Advertisement

PHP select query print out numerous items from database [closed]

My Table

So I want it to print off like

And then to repeat for each type of coffee

Is there any web pages that allow me to do this

Currently, this is what I have but know it is not correct. Any help much appreciated?

Advertisement

Answer

You might need to update the SQL query first, in order to retrieve data in the manner you want.

so let’s say if your database table looks like below

Your SQL query should be:

And the expected output of this query should be

If you get the expected result, then PHP implement should be:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement