that's a fab idea... :)

Thanks!

T

On 3 Jun 2007, at 14:41, Dan O'Keefe wrote:

> Tom,
>
> One method I have used in the past is when you query the join table  
> and
> display the results, store the EventJoinID 's in a list hidden form
> variable. Then on post, wrapped in transaction, a single delete  
> statement
> using the EventJoinID 's list will delete all of the old records,  
> and then
> loop over your new joins and insert.
>
> It eliminates the need of worrying if a join was changed or  
> deleted. You can
> also use <cftry> & <cfcatch> to handle the transaction failing.
>
> Dan
>
> On 6/3/07, Tom King <[EMAIL PROTECTED]> wrote:
>>
>> Hi All,
>>
>> Just set up a MySql DB, and I'm trying to work out the best way to
>> update multiple tables via CF:
>>
>> I.e:
>>
>> TblEvent
>> ------------
>> EventID [key]
>> EventName
>>
>> tblEventType
>> ------------
>> EventTypeID [key]
>> EventTypeName
>>
>> tblEventJoin
>> ------------
>> EventJoinID [key]
>> EventID
>> EventTypeID
>>
>> So above, I might have an EventID, which has multple EventTypeIDs
>> associated with it in tblEventJoin
>>
>> At the moment, the only way I can see of updating the tblEventJoin
>> (assuming I have an EventiD and several EventTypeIDs which are
>> associated) is to Query tblEventJoin, work out whether the Row
>> already exists, if not Insert the record, and if a row exists which
>> shouldnt, delete it.
>>
>> What's the best way to actually do this? Multiple CFQueries, and do
>> the logic CF side, or is there a better method?
>>
>> As you can see, still a newbie on this..
>>
>>
>> Ta
>>
>> T
>>
>>
>>
>>
>>
>>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279935
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to