[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 455
  • Last Modified:

What is wrong with this insert?

<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "Register">
      <cfinclude template="qry_Register.cfm">
      <cfif rsRegister.RecordCount LT 1>
      <!--- FORM Paramters --->
      <CFPARAM name="form.PlayerPassID" default="">
      <CFPARAM name="form.PlayerLevel" default="">
      <CFPARAM name="form.FirstName" default="">
      <CFPARAM name="form.LastName" default="">
      <CFPARAM name="form.Address" default="">
      <CFPARAM name="form.City" default="">
      <CFPARAM name="form.State" default="">
      <CFPARAM name="form.Zipcode" default="">
      <CFPARAM name="form.HomePhone" default="">
      <CFPARAM name="form.WorkPhone" default="">
      <CFPARAM name="form.MobilePhone" default="">
      <CFPARAM name="form.EmailAddress" default="">
      <CFPARAM name="form.Birthdate" default="">
      <CFPARAM name="form.Gender" default="">
      <CFPARAM name="form.CurrentTeam" default="">
      <CFPARAM name="form.CurrentLeague" default="">
      <CFPARAM name="form.StateAssociation" default="">
      <CFPARAM name="form.LastTeam" default="">
      <CFPARAM name="form.LastSeason" default="">
      <CFPARAM name="form.PrimaryPosition" default="">
      <CFPARAM name="form.SecondaryPosition" default="">
      <CFPARAM name="form.IDNumber" default="">
      <CFPARAM name="form.IDType" default="">
      <CFPARAM name="form.BirthCountry" default="">
      <CFPARAM name="form.USCitizen" default="">

      
      <!--- Query - Insert --->
      <cfquery datasource="#mm_outlawsilverbacks_dsn#">
        INSERT INTO Players (PlayerPassID, PlayerLevel, FirstName, LastName, Address, City, State, Zipcode, HomePhone, WorkPhone,                   MobilePhone, EmailAddress, Birthdate, Gender, CurrentTeam, CurrentLeague, StateAssociation, LastTeam, LastSeason, PrimaryPosition, SecondaryPosition, IDNumber, IDType, BirthCountry, USCitizen)
  VALUES (
      <cfqueryparam value="#FORM.PlayerPassID#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.PlayerPassID))#">,
      <cfqueryparam value="#FORM.PlayerLevel#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.PlayerLevel))#">,
      <cfqueryparam value="#FORM.FirstName#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.FirstName))#">,
      <cfqueryparam value="#FORM.LastName#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.LastName))#">,
      <cfqueryparam value="#FORM.FirstName#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.FirstName))#">,
      <cfqueryparam value="#FORM.Address#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.Address))#">,
      <cfqueryparam value="#FORM.City#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.City))#">,
      <cfqueryparam value="#FORM.State#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.State))#">,
      <cfqueryparam value="#FORM.Zipcode#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.Zipcode))#">,
      <cfqueryparam value="#FORM.HomePhone#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.HomePhone))#">,
      <cfqueryparam value="#FORM.WorkPhone#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.WorkPhone))#">,
      <cfqueryparam value="#FORM.MobilePhone#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.MobilePhone))#">,
      <cfqueryparam value="#FORM.EmailAddress#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.EmailAddress))#">,
      <cfqueryparam value="#FORM.Birthdate#" cfsqltype="cf_sql_date" null="#Yesnoformat(NOT LEN(form.Birthdate))#">,
      <cfqueryparam value="#FORM.Gender#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.Gender))#">,
      <cfqueryparam value="#FORM.CurrentTeam#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.CurrentTeam))#">,
      <cfqueryparam value="#FORM.CurrentLeague#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.CurrentLeague))#">,
      <cfqueryparam value="#FORM.StateAssociation#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.StateAssociation))#">,
      <cfqueryparam value="#FORM.LastTeam#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.LastTeam))#">,
      <cfqueryparam value="#FORM.LastSeason#" cfsqltype="CF_SQL_INTEGER">,
      <cfqueryparam value="#FORM.PrimaryPosition#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.PrimaryPosition))#">,
      <cfqueryparam value="#FORM.SecondaryPosition#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.SecondaryPosition))#">,
      <cfqueryparam value="#FORM.IDNumber#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.IDNumber))#">,
      <cfqueryparam value="#FORM.IDType#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.IDType))#">,
      <cfqueryparam value="#FORM.BirthCountry#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.BirthCountry))#">,
      <cfqueryparam value="#FORM.USCitizen#" cfsqltype="CF_SQL_VARCHAR" null="#Yesnoformat(NOT LEN(form.USCitizen))#">
      )
      </cfquery>
      <cfinclude template="dsp_Confirmation.cfm">
      <cfelse>
            <cflocation url="index.cfm?shot=error&code=2">
      </cfif>
</cfif>
0
jollymon6672
Asked:
jollymon6672
1 Solution
 
tim_csCommented:
You have firstname in there twice for the values.  Once before LastName and once after.  
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now