sql joins model to controller to view

Permalink
I posted this in someone else's thread - Is there a simple top to bottom demo of joined tables with sql ? I mean top being Model - Controller - View.

I can write sql to join tables but to simply executing a view from the 2 joined tables is probably simple but it is escaping my mind - after googleing like crazy and reading tons of forum questions I really don't see the answer
But in most of the packages I have seen they are using sql joins - so I get a little lost when it comes to actual accessing and presenting the data from both tables (in the view,php )

A simple demo of a simple inner join
model - classes and sql join


select players.name
from players
inner join teams
on players.team = teams.name



controller - to load model - Loader:: model ('Players');
etc.


view -

( This is where I get confused, I WOULD LIKE TO NAME A TEAM THEN NAME ALL THE PLAYERS NAMES FROM EACH TEAM )



Anwyay just typed in syntax to give you an idea of a demo I would like to see it is no way an offer of how to do it. It could be States table and cities etc. A demo of a simple join from top to bottom I think would help a lot of people like me ( new to Concrete 5 but not new to SQL )

INTcommunications