Skip to main content
June 17, 2006
Question

A few easy fixes I am sure

  • June 17, 2006
  • 1 reply
  • 221 views
Hello,

For a pervious action the forum data is updated like so:

<CFINSERT DATASOURCE="#Database.DSN#" TABLENAME="Posts" FORMFIELDS="PostAuthor, PostHeader, PostMessage, TopPost">

I was wondering how to add the following to this not only do I want the following operation to be carried I want the "INSERT" to add a number to a field in another table "WHERE UsersID = #URL.ID#" On its own the query looks like this:

<cfquery name="points" datasource="ukgl.co.uk">
SELECT UserPercent
FROM users
WHERE UsersID = #URL.ID#
</cfquery>

I want that to be incorporated into the "INSERT" query above and also add "20" to the "UsersPercent" Field.

Many Thanks

Hugh
This topic has been closed for replies.

1 reply

Inspiring
June 17, 2006
I am not clear on what you want. A CFINSERT only accepts input from Form
values. Are you wanting to pick up the newly created ID and then apply the
second action using that ID.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Hugh Neale" <webforumsuser@macromedia.com> wrote in message
news:e70m24$9oi$1@forums.macromedia.com...
> Hello,
>
> For a pervious action the forum data is updated like so:
>
> <CFINSERT DATASOURCE="#Database.DSN#" TABLENAME="Posts"
> FORMFIELDS="PostAuthor, PostHeader, PostMessage, TopPost">
>
> I was wondering how to add the following to this not only do I want the
> following operation to be carried I want the "INSERT" to add a number to a
> field in another table "WHERE UsersID = #URL.ID#" On its own the query
> looks
> like this:
>
> <cfquery name="points" datasource="ukgl.co.uk">
> SELECT UserPercent
> FROM users
> WHERE UsersID = #URL.ID#
> </cfquery>
>
> I want that to be incorporated into the "INSERT" query above and also add
> "20"
> to the "UsersPercent" Field.
>
> Many Thanks
>
> Hugh
>
>