I have a few questions... I am trying to create a weight loss database whereby each member may keep track of his or her weight on a weekly basis and then graph the results over time. I've put off this project for a long time due to my inability to find a suitable graphing script. I've found one now, but need help exporting the data to it, plus a couple other things also.
1. Is there a way to limit users to one record per week? (Just when you thought there were no other permutations, too!) If not, this isn't essential. It'd be nice, though.
2. Is there a way to pull the data from one field of the last record to another field in the current record? I want to pull the "weight" field from the last record to this record's "LastWeight". Carol, you helped me last year do something similar through sub get_defaults in db.cgi but in that case it was always pulling from "yesterday's" record so I'm not quite sure how to pull it in this case.
3. Then, finally, the thing that should hopefully pull this all together... the graphing script (in PHP) I found requires two arrays to create the graph. The format is $names = array(1, 2, 3, 4, 5) and so forth, and $values = array(1, 2, 3, 4, 5) and so on. What do I need to do to get the results of a search and place all instances of "Week" in the $names array and all instances of "Weight" in the $values array that can be processed through a hidden field on a form?
(The database is set up so that each user may only view, modify, delete, etc his or her own records, so the search will only return that user's records. Also, the ID is the username plus the date [i.e., guest03-Jul-2000] which was set up in a previous journal to prevent more than one entry per day...I thought it would work well in this database as well. )
hmmm...think I've covered everything. Just hope it makes sense. Thanks!
Melanie
http://www.somemoorecats.com/
http://www.okhima.org/
1. Is there a way to limit users to one record per week? (Just when you thought there were no other permutations, too!) If not, this isn't essential. It'd be nice, though.
2. Is there a way to pull the data from one field of the last record to another field in the current record? I want to pull the "weight" field from the last record to this record's "LastWeight". Carol, you helped me last year do something similar through sub get_defaults in db.cgi but in that case it was always pulling from "yesterday's" record so I'm not quite sure how to pull it in this case.
3. Then, finally, the thing that should hopefully pull this all together... the graphing script (in PHP) I found requires two arrays to create the graph. The format is $names = array(1, 2, 3, 4, 5) and so forth, and $values = array(1, 2, 3, 4, 5) and so on. What do I need to do to get the results of a search and place all instances of "Week" in the $names array and all instances of "Weight" in the $values array that can be processed through a hidden field on a form?
(The database is set up so that each user may only view, modify, delete, etc his or her own records, so the search will only return that user's records. Also, the ID is the username plus the date [i.e., guest03-Jul-2000] which was set up in a previous journal to prevent more than one entry per day...I thought it would work well in this database as well. )
hmmm...think I've covered everything. Just hope it makes sense. Thanks!
Melanie
http://www.somemoorecats.com/
http://www.okhima.org/