PHP Help with Select Form

Hey guys,

I’m very much a novice when it comes to PHP, but I’m learning it and trying to implement it on my site. I’ve run into an issue that I hoping someone can help me to fix rather quickly.

I have a submission form which I am attempting to use. At the top of the page, you will notice the dropdown which I have managed to successfully populate with data from my SQL table. However, I have two problems.

First, I would like for the dropdown population to only represent the players in the team dropdown lower on the page. For example, if I select Boston from the teams dropdown, I only want players on Boston to appear in the top dropdown. I also am planning to move the top dropdown below the others but have yet to do so.

Second, I have the form setup to email the results to my server email using the recipient command; however, it is only submitting part of the information. Here is a copy of the line of code:

print "<select name=winter id=player class=list style='width:500px'>"; $result = mysql_query("SELECT P.last_name, P.first_name, P.position, FROM players P, teams T WHERE P.experience=0 AND T.team_id=P.organization_id ORDER BY organization_id ASC, last_name ASC") or die(mysql_error());; while ($row = @mysql_fetch_array($result,MYSQL_ASSOC)) { print "<option value=".$row{'last_name'}.", ".$row{'first_name'}.", ".$row{'position'}."-- ".$row{'name'}.">".$row{'last_name'}.", ".$row{'first_name'}.", ".$row{'position'}."-- ".$row{'name'}."</option>"; } print "</select>";
For whatever reason, the only thing getting to me via email is the last_name. I assume it is some form of syntax error, but I cannot figure out why I can't receive the rest of the information such as first_name, position, and team.

Any help would be appreciated!

Sponsor our Newsletter | Privacy Policy | Terms of Service