Skip to main content
Known Participant
July 13, 2010
Question

CFinsert (another route - from previous post)

  • July 13, 2010
  • 1 reply
  • 630 views

I query a "Clientsinfo" table to get the LASTNAME,FIRSTNAME from a "form" being submited base on a phonenumber in the form.

Now I want to INSERT the form fields - Plus the query above - LASTNAME,FIRSTNAME.

I used: 
   
<CFINSERT DATASOURCE="storefront" TABLENAME="sales" formFields = "client_id,booksales,booktitle,lastname,firstname">

It works - BUT the LASTNAME OR FIRSTNAME does NOT get inserted.  The fields are blank.

Do I make things difficult or what??? 

This topic has been closed for replies.

1 reply

Inspiring
July 13, 2010

Couple of questions so we can help you out:

1. What database type?

2. When you say that "it works" does that mean that you verified that a new record appeared in the table?

3. If a new record appeared, what other data from your form variables were successfully entered?

4. If you do a CFDUMP of the form scope prior to the CFINSERT, are the form fields populated?

-reed

Known Participant
July 13, 2010

It's an Access db.  The table has lastname,firstname as fields.  So when I do the insert, all the other data from the "form" salesdate, totalsale, clientID is all inserted... except lastname,firstname from the query of the 2nd table.

I am going to try what you posted eariler about query of TWO tables at the same time.  That is really what I want but I was trying to take another route.