Score sheet entry form for a hockey coach

mistux
mistux used Ask the Experts™
on
I am a hockey coach and I need a way to let my volunteers enter the scoresheets on the web.  I am Familiar with VBA (I do MS Access programming), but getting new to the web stuff (and also PHP, our server dosen't support ASP).

I have built a MySQL database with the tables and data. What I am thinking is that I need to have a page to prompt for the two teams and how many scores, then post and return a page that has the two teams players "hidden in it" so that when the volunteer goes to enter a score they select the team from one dropdown, then then next dropdown will contain the correct teams player list for them to pick from.

1.  I don't know how to make the two teams player list available in the returned page.
2.  i don't know how to base the second combobox (player listing) on the first combobox (team listing).

Could you aid in my assistants, please.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
i dont have the time to make the whole thing, but ill post on certain specific topics..
==============================================================
[EXAMPLE CODE IN PHP]
<?php
    /* Connecting, selecting database */
    $link = mysql_connect("mysql_host", "mysql_user", "mysql_password")
        or die("Could not connect");
    print "Connected successfully";
    mysql_select_db("my_database") or die("Could not select database");

    /* Performing SQL query */
    $query = "SELECT * FROM my_table";
    $result = mysql_query($query) or die("Query failed");

    /* Printing results in HTML */
    print "<table>\n";
    while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
        print "\t<tr>\n";
        foreach ($line as $col_value) {
            print "\t\t<td>$col_value</td>\n";
        }
        print "\t</tr>\n";
    }
    print "</table>\n";

    /* Free resultset */
    mysql_free_result($result);

    /* Closing connection */
    mysql_close($link);
?>


============================================================
[CODE OF A HTML FORM]

<form action="TheScript.php">
<input type="text" name="hello1"/>
<input type="text" name="hello2"/>
<input type="text" name="hello3"/>
<input type="text" name="hello4"/>
<input type="text" name="hello5"/>
....
....
</form>


============================================================
[PHP EXAMPLE TO GET FORM DATA]

<?php echo "$HTTP_POST_VARS[hello1]"; ?>
<?php echo "$HTTP_POST_VARS[hello2]"; ?>
<?php echo "$HTTP_POST_VARS[hello3]"; ?>


============================================================
[SQL TO INSERT DATA]

insert into <tablename> (<col 1 name>, <col 2 name>, <col 3 name>, <col 4 name>) values(<value 1>, <value 2>, <value 3>, <value 4>)


============================================================
[PHP TO QUERY ABOVE SQL]

    /* Connecting, selecting database */
    $link = mysql_connect("mysql_host", "mysql_user", "mysql_password")
        or die("Could not connect");
    print "Connected successfully";
    mysql_select_db("my_database") or die("Could not select database");

$query = "insert into <tablename> (<col 1 name>, <col 2 name>, <col 3 name>, <col 4 name>) values(<value 1>, <value 2>, <value 3>, <value 4>)";
$result = mysql_query($query) or die("Query failed");

============================================================


I hope you can put this all together and build a working program. Good Luck!

Author

Commented:
Thanks for the reply, however let me try to expand on my issue.

1.  I don't know how to populate a dropdown list based on the the selection of a previous dropdown list.  Example: the Player Listing based on the Team selected.  I intend on haveing one form with as many "rows" of this combination as is needed to enter all the scores for one game (as opposed to having just one row and posting it and comming back each time.)

Thanks.

Author

Commented:
Specifically how do you base one dropdown on the first dropdown, i.e. Team then roaster for that specific team?

I imagine that I need an arrow to hold both roasters, but where do I put it (or hide it) so that the dropdowns can get to them?

Thansk.

Author

Commented:
I'll accept this and thank you for your time and trouble, even though my subsequesnt question based on the first question has yet to.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial