[eluser]Unknown[/eluser]
Hi all,
This is my first foray into CI so please bare with me. I'm not the most experienced PHPer either, but have been dabbling for a while.
i am setting up an app which is a log basically for recording weight lifting workouts.
I have 3 tables in my DB: 'workouts', 'exercises' and 'exercise_list'.
Quote:workouts:
| id | datetime | misc1 | misc2 |
exercises:
| id | ex_id | wo_id | weight | reps | wo_order |
exercise_list:
| id | title |
So far I have generated a view which grabs details of a specific workout (myurl.com/workouts/view/<datetime>)
I have built a query that grabs the fields from 'workouts' and also it grabs any 'exercises' entries that correspond to that
workout (by get_where using wo_id).
I build a view which lists the exercises for that workout, but I can only get as far as foreach'ing out the 'id' of the exercise. I need to somehow have a further query that grabs the 'title' of each exercise that is associated with that workout 'id'.
So I currently have a table (html):
Quote:| Exercise | Weight | Reps |
| 1 | 50 | 8 |
...
I need '1' to become the title of the exercise in 'exercise_list' with an 'id' of '1'.
Hope that makes sense.
Thanks in advance.