Gossamer Forum
Home : Products : DBMan : Customization :

How can I add "1/2 a record"?

Quote Reply
How can I add "1/2 a record"?
Greetings,

I am using this DBMan to post/record my golf score. So when I add a "New Record", I have the following fields:

Course name, course address, course info etc., myscore1, myscore2, etc. myscore18, etc.

Example:
Pebble Beach, 123 Something Drive, Somecity, CA, etc. then myscoreX is 4, 5, 3, 5, 6, bla bla till myscore18

So, next time when I add a "New Record" I would like to have the course information populated on the form and all I have to do is key in myscoreX part.

I am thinking to have to links when I click "Add Record"

1. Enter New Score
2. Select a previously entered course
- Pebble Beach
- Augusta
- Local Muni Course
- Will list all the courses I entered before

Question:
1. How do I go about making the happen?


Thanks Guys
Quote Reply
Re: [webperlnewbie] How can I add "1/2 a record"? In reply to
sounds like you need a relational database consisting of two files:

courses would have fields: id, name, address etc, plus par1 par2 par3 ... par18 (i assume you would want to know what par is on each hole)

the second file, scores, would have fields: id (sequentially numbered automatically), course-id (pulled from other file), date, score1, score2 etc

there's a tutorial on building relational databases at http://www.jpdeni.com/.../Mods/relational.txt

good luck!
Quote Reply
Re: [delicia] How can I add "1/2 a record"? In reply to
Thanks delicia for your reply.

After I posted my question, I did a lot of searching on this forum and the Faqs site. Found several Mods that I could tweak to make it fit my application. One of them was the "Category and Count Mod". This is what I was able to achieved.

1. I added a "sub html_pre_add_form" to provide 2 ways of adding a new record.

Example:
Add a new score and course (link to ...add_form=1)

OR

Select a previously entered course from list below:
- Pebble Beach (2) <-------- (link to ...add_form=1&Course_Name=Pebble%20Beach)
- Augusta (1) <-------- (link to ...add_form=1&Course_Name=Augusta)
- Cog Hill (5) <-------- (link to ...add_form=1&Course_Name=Cog%20Hill)
- $option (9) <-------- (link to ...add_form=1&Course_Name=$encoded)

Note: Number in ( ) indicates the number of time(s) played previously.

So now, when I select "Pebble Beach", all the course information I entered the first time will be autofilled and all I have to now is just enter my score from Hole 1 to Hole 18.
Quote Reply
Re: [webperlnewbie] How can I add "1/2 a record"? In reply to
your technique should work fine, but i'm too much a geek to have redundant info in one database, especially if you're interested in storing the par for each hole. if i didn't store par for each hold, i wouldn't store the shots per hole, just the total.

i haven't played any of the courses on your list, but i'm going to scotland next september -- maybe i'll get to play the old course!
Quote Reply
Re: [delicia] How can I add "1/2 a record"? In reply to
LOL

the list is just my test.db or rather my dream courses that i would love to play at least once before i die.

have fun over at scotland delicia

SlySly