⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

help with relational/multi table issues



mhodges
  • profile picture
  • Member

Posted 02 December 2012 - 15:58 PM

I have been playing with grocerycrud and I must say it is pretty cool. Easy to use, works well and looks nice.

That being said I am a total noob when it comes to coding and only slightly less of a noob with database stuffs.

My issue...
I am setting up a database system for a non-profit Youth football league...

I have a table called players which has basic, static info on a player (ie. fname, lname, dob, parent1, parent2)...

I also have tables for gear (ie. helmets, pads, pants) that will be linked with players (ie. helmets.assigned=players.id) and notes tables for each gear table (ie. helmet_notes.tag=helmets.tag)

I have a table called player_season which has information related to the player for each season (ie. age, weight, jersey_number) - this table is linked to players (player_season.player_id=players.id)...

I have a table called player_medical which has information related to the player (ie. injuries, allergies, asthma) - this table is linked to players (player_medical.player_id=players.id)

I have two tables father_info and mother_info, same layout for each (ie. fname, lname, address, phone) - each of these are linked to the players table (players.parent1=father_info.id and players.parent2=mother_info)

I have setup gcrud and have the players table working without issue. What I need to do is link the other tables on the add and edit screens so that when I add a new player I can link an existing parent record or add a new parent record as well as season and medical info.

I have been able to successfully link the player_season table on the add/edit screens but I can not figure out if possible/how to add additional tables.

I would love to use gcrud but I need to figure this out before it is worthwhile for me. Any assistance is very much appreciated.

if it helps a basic layout idea is as follows......

-----------------------------------------------
| |
| Players_table |
| |
| player_season (by players.id) |
| |
| player_medical (by players.id) |
| |
| father_info (by players.parent1) |
|mother_info (by players.parent2) |
| |
|Helmet, pads, pants assigned |
| by players.id |
-----------------------------------------------


ps...
players.parent1 and players.parent2 are select boxes linked to father_info.id and mother_info.id...I noticed a post about adding records with fancyboxes without leaving the page....maybe this is an easier way to deal with what I want to do but again I don't have a clue about how to make this all work.