I need an advice how to display data from array (result of sql query) in PHP.
Here's the problem:
My query result is 2 row (top figure). Currently, I'm using foreach
method to display all data, thus, the foreach
will iterate 2 times, right?
Now, I want to ask: In my web page, how I can display like the bottom figure??
How to join the second row (the theory's score is 0, and the lab's score is 75 and 80) to the first row? So it'll be ONLY 1 row for ID 112.
EDIT:
The SQL query is not my part. I've just received that data (top figure), and my job only to display it to web page.