使用基础部分与PHP

I am using the sections feature in the Foundation framework, "http://foundation.zurb.com/docs/components/section.html#panel2".

My website is for a soccer club where I have a bunch of teams in a database table named "team". The team table has the following columns: team_id,team_name.

I also have a table named "players".

The players table has the following columns: id,first_name,last_name,team_id.

I want to make a section for each team where the tab is labeled the "team_name" from the "team" table, and the content of that section is all players on that team and will list all player names in that section.

If I'm understanding the question correctly, then you can just get the team id and then use:

SELECT * FROM `players` WHERE `team_id`='7';

With "7" being an example id. Alternately you can have it all in one query:

SELECT * FROM `players` t1 INNER JOIN `teams` t2 ON t2.team_name = 'example' AND t1.team_id = t2.team_id;

or

SELECT * FROM `players` t1, `teams` t2 WHERE t2.team_name = 'example' AND t1.team_id = t2.team_id