Ok I have a table with a few fields. One of the fields is username. There are many times where the username is the same, for example:
I like to separate the DB logic from the display. I generally put my results into an array that I can call within the HTML code. Purely personal preference; but here's how'd I'd approach the problem: (I'd take the $sql out of the error message in production)
HTML CODE
foreach ($USERS as $USER) { ?>
Study: =$USER['dbFieldName'];?> - =$USER['dbFieldName2'];?>
} //foreach $USER ?>