Coldfusion MySQL INSERT Problem

OK, I'm using the following code to process a form and insert the form contents into my MySQL database. I've run the SQL code seperately by manually putting in values and it runs just fine. Also, I ran a CFOUTPUT to make sure the values were being passed and they all were. For some reason, the transaction is failing though and the insert is not happening. The ContribNum value is blank because it's an autoincrement field in the database. Anyone got any ideas what I'm missing?  

<cftransaction action="begin">
    <cftry>
      <cfquery name="qAddContrib" datasource="CDS_App_GivingBeta">
        INSERT INTO givingbeta.names
      (Address1,
      Address2,
      City,
      Country,
      EnvNum,
      FirstName,
      LastName,
      SSN,
      State,
      Zip,
      ContribNum,
      UUID)
      VALUES('#FORM.Address1#',
      '#FORM.Address2#',
      '#FORM.City#',
      '#FORM.Country#',
      '#FORM.EnvNum#',
      '#FORM.FirstName#',
      '#FORM.LastName#',
      '#FORM.SSN#',
      '#FORM.State#',
      '#FORM.Zip#',
      '',
      '#CreateUUID()#'
      )
      </cfquery>
      <cfset confirmadd = "yes">
      <cftransaction action="COMMIT" />
      <cfcatch type="DATABASE">
                <cftransaction action="ROLLBACK" />
            <cfset confirmadd = "no">
      </cfcatch>
    </cftry>
  </cftransaction>
<cflocation url="contrib_list.cfm?confirmadd=#confirmadd#">
ndcollinsAsked:
Who is Participating?
 
wytcomCommented:
With MS SQL, I would omit the autoincrement fields from the query.  You could try removing both the field name and the associated blank value.
0
 
ndcollinsAuthor Commented:
This is MySQL, not MS SQL. In any case, I did try that and still no joy.
0
 
ndcollinsAuthor Commented:
Your comment did make me think of a couple other things to try through, and I've now got it working. Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.