How do I do it?

I have seen something that looks like this:

<cfscript>
     // create a job componet object
     newJob = createObject("component", "job");
     // now set the properties of if from our form
     newJob.name = form.name;
     // now insert job into the database
     newJob.insertJob();
</cfscript>

And I have seen it done like this:

<cfscript>
newJob = createObject("component","job");
newJob.insertJob(name=form.name);
</cfscript>

Which is correct? What if I had 10 arguments that all needed values,
would I pass them in like so:

newJob.insertJob(id=form.id, name=form.name, location=form.location, etc. etc);

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232625
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to