I have been trying to learn php/mysql on my own and have been doing pretty good from tutorials and online manuals but have hit a wall here.
What I am trying to figur out is how to use info from a table such that
Table name profiles
Table Fields
instructional_area
first_name
last_name
title
I want to create a loop that returns:
<h1>instructional_area1</h1>
<ul>
<li>first_name1 lastname1- title1
<li>first_name2 lastname2- title2
</ul>
<h1>instructional_area2</h1>
<ul>
<li>first_name1 lastname1- title1
<li>first_name2 lastname2- title2
</ul>
I have done somethin similar with two tables but not with all the data in the same table. foreach seems like it has potential to do it but I can't seem to get it right, or should I be looking at sql statement join or grouping?
I am running this sql statement:
$profiles= @("SELECT * from profiles ORDER BY last_name, first_name");