Announcement

Collapse
No announcement yet.

form to build exercises with multiple items

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • form to build exercises with multiple items

    Hi,

    I've created a table of exercises with name, photo, description, muscles (selected from another table), movements (also from another table), and 4 items that are also choosen from other tables

    Now, I want to build a table called session that contents several exercises.
    How can I do for choose each exercise and keep all the items (even selected from another tables, not the key). When I use the lookup in automatic way I can only rescue data from one table. Must I use the manuel way, and if so, how do I have to do?

    Thanks

  • #2
    One option might be to add manual fields. then in the onload event you can do the appropiate select(s) from your table(s) and fill the custom fields.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      How about using the following tables (just the info, I assume you can make the sql yourself in detail):
      excercises(key as number, name ....);
      movements(key as number,name ....);
      muscles(key as as number,name ...);
      excercises_movements(excercises_key as number,movements_key as number);
      excercises_muscles(excercises_key as number,muscles_key as number);

      Then do some inner join:
      select excercises.*,movements.*,muscles.* from excercises,movements,muscles,excercises_movements, excercise_movements where
      excercises.key=excercises_movements.excercises_key and movements.key=excercises_movements.movements_key and
      excercises.key=excercises_muscles.excercises_key and muscles.key=excercises_muscles.emuscles_key
      and excercises.key={MYKEY} order by excercises.name,movements.name,muscles.name;


      You may want to do an outer join version but that is up to you... And it is up to what you want to do with it...

      Your table session:
      session(key as number,excercise_key as number);


      So now querying a session is thus:
      select excercises.*,movements.*,muscles.* from excercises,movements,muscles,excercises_movements, excercise_movements where
      excercises.key=excercises_movements.excercises_key and movements.key=excercises_movements.movements_key and
      excercises.key=excercises_muscles.excercises_key and muscles.key=excercises_muscles.emuscles_key
      and excercises.key in (select excercises_key from session where session.key={MYKEY})
      order by excercises_order,excercises.name,movements.name,mu scles.name;

      I leave it up to you to add an excercise_order in there if you so wish...

      Comment


      • #4
        Thanks I'll try it

        Comment

        Working...
        X