Hello everyone. I'm new to php programming and have several questions about forms. I'm curious to see if what I want to do is possible before I invest alot of time to piece the code together. I'm putting together a web page for my baseball league as they don't have any at the time of this post. I'm also using MySQL to hold all of the game dates, game locations, home and visitor teams. I want to add a dynamic form to my administration page to allow the league director or myself the chance of changing a game date, location, etc. So here it goes
1) I would like to access my MySQL database to populate a list on my form for the game dates available. No any date, only the dates already pre-entered in the data base.
2) When a particular date is selected, is it possible to populate three other form list entries with the corresponding location, home team and visitor team for the selected date. This would provide an immediate visual to the director and/or myself that the correct row is selected (however, this is not necessary).
3) I want to populate the lists for location, home team and visitor team with the DISTINCT code to select the corresponding info only once. I could easily hard code the values but would like the flexibility for adding/removing teams in the database in the future.
4) Once the date, location, team home and team visitor have been adjusted, I need to change the old dates team home and team visitor to "OPN" to allow us to know it's availability.
Thank-you in advance.....
Dynamic forms
Moderator: General Moderators
Yes, it's possible. In fact, very common coding!
Give your games a unique id in the database table, and your coding should be a breeze.
Give your games a unique id in the database table, and your coding should be a breeze.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
-
Todlerone
- Forum Commoner
- Posts: 96
- Joined: Sun Oct 28, 2007 10:20 pm
- Location: Hamilton, Ontario, Canada
Thanks for the responses. I would prefer not to use the javascript (if it is possible as I would like to learn/understand PHP/MySQL alittle better before I dive into learning that also). I have found alot of sample codes to do parts of what I want. I have seen code to query my database then split the $result into separate arrays for each field of my table, etc, etc. I don't have a problem with any of the code to post a <value> listing my database results. The part I can't get my head around is within the form itself. I need 4 text areas, the first one needs to populate the other three. Is there a way of knowing which row the first "Date" text field is. I do have a unique GameID (auto increment) field in my database. If javascript is really easy for this does anyone have a link to a sample of it.
Again thank-you in advance...
Again thank-you in advance...