[development] Many to many relationships?

Graeme McKibbin gmckibbin at iburst.co.za
Thu Jan 31 21:13:28 UTC 2008


Ok, I need to have 3 dropdowns, each containing the same list of  
items  (say Transport, Fuel, Food)
Then I need to be able to assign a value to each of them.

Now let's say I have an input form that will be filled in each day,  
and on day 1, I select:
Transport =  200 km
Fuel = $20
Food = $5

Then on Day 2, I select:
Transport =  300 km
Fuel = $30
Food = $7

Now, this is what I need it for. I want a View of my total daily  
activities to display in the following way:

        Chargeables 				
        500km Transport    		
        $50 Fuel
        $12 Food

In other words, in classic database structure, I'd have a link (or  
'hamburger') table containing foreign keys to the Items table and the  
value (price) per item per day.
Does that make sense?

Basically, I'm struggling to figure out how to get the data into the  
system in that way so that it can be output in the way I need it.
Unless there's another way to do it in Drupal?


On 31 Jan 2008, at 10:53 PM, John Fiala wrote:

> On 1/30/08, Graeme McKibbin <gmckibbin at iburst.co.za> wrote:
>>  Does anybody know how to create the equivalent of a many-to-many
>> relationship?
>>
>> Ie: On an input form, say I have a dropdown with 5 items in it. I  
>> want the
>> user to be able to select one, and then input an integer value  
>> that would be
>> associated with the selected item.
>
> What's the intention of the many-to-many relationship?  Why are you
> associating the value?  It's a little hard to say what would be the
> best way to handle this without knowing what you're doing in a little
> more detail.
>
>
> -- 
> John Fiala




Kind Regards

Graeme McKibbin
Software Developer

T. 011 704 6415
C. 082 921 3447



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20080131/d432ac7b/attachment-0001.htm 


More information about the development mailing list