method that takes 2 args, name and age. Your form fields could be
called Darth and Luke, and this will work fine:
(in calling document)
<cfset theCFCInstance.theMethod(form.darth,form.luke)>
Now in your CFC you have....
<cffunction name="theMethod" ....>
<cfargument name="name" ....>
<cfargument name="age" ....>
and then you can do your db call here, and it doesn't what the db
columns are. Imagine they are personName and personAge. The following
code is ok:
<cfquery ....>
insert into foo(personName,personAge)
values('#arguments.name#',#arguments.age#)
The point is, it doesn't matter what your form fields are called. It
doesn't matter what your arguments are. Use names that make sense.
On Thu, 14 Oct 2004 13:57:14 -0400, sonicDivx <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am trying to decide which method to pass form data to a CFC that is going
> to add the data to a DB.
>
> My form field names are not the same as the database fieldnames so I need to
> pass the following;
>
> formfield name | database fieldname | formfield value
>
> So Was going to do an Array but was wondering if doing a nested Structure
> wouldn't be easier. Performance is a minor issue.
>
> Any thoughts
> Thanks
> Kevin
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

