Syntax Error Update Statement

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Syntax Error Update Statement

    Can someone tell me what's wrong with this code? I need help. Thanks! It is
    an update page.

    FIRST PAGE: LOGIN CHECK

    <!---
    Filename: LoginCheck.cfm
    Purpose: Validates a user's password entries
    Please Note: Included by Login.cfm
    --->
    <!---Make sure we have email and Password--->
    <cfparam name="form.email" type="string" default="heather@suntrust.com">
    <cfparam name="form.password" type="string" default="buddy">
    <!---find record with this email/password--->
    <!---If no rows returned, password not valid--->
    <cfquery name="GetUser" datasource="#DataSource#">
    SELECT MemID, Email, LastName, FirstName, Precon, FetalDev, InfantDev,
    SMAlerts, WhatsNew, Unsubscribe
    FROM tbl_members
    WHERE Email ='#Form.email#'
    AND Password ='#Form.password#'
    </cfquery>
    <!---If the username and password are correct--->
    <CFIF GetUser.RecordCount EQ 1>
    <!---Remember user's logged in status plus memID and first name--->
    <cfset session.Auth = StructNew()>
    <cfset session.Auth.IsLoggedIn = "yes">
    <cfset session.Auth.MemID = GetUser.MemID>
    <cfset session.Auth.Email = GetUser.Email>
    <cfset session.Auth.LastName = GetUser.LastName>
    <cfset session.Auth.FirstName = GetUser.FirstName>
    <cfset session.Auth.Unsubscribe = GetUser.Unsubscribe>
    <cfset session.Auth.Precon = GetUser.Precon>
    <cfset session.Auth.FetalDev = GetUser.FetalDev>
    <cfset session.Auth.InfantDev = GetUser.InfantDev>
    <cfset session.Auth.SMAlerts = GetUser.SMAlerts>
    <cfset session.Auth.WhatsNew = GetUser.WhatsNew>
    </CFIF>
    <!---Now that user is logged in, send them to the update page--->
    <cflocation url="update_membership.cfm">

    SECOND PAGE: UPDATE MEMBERSHIP

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Update Your Profile | SmartMomma</title>
    <link href="../css/customerclass.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    body {
    margin-left: 3px;
    margin-top: 0px;
    }
    -->
    </link>.style1 {color: #000000}
    .style2 {color: #FF0000}
    -->
    </style>
    </head>

    <body>
    <table width="791" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
    <td height="55" colspan="5" valign="top"><table width="100%" border="0"
    cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
    <td width="212" height="50" valign="top"><img
    src="../images/smartmomma%20Logo.gif" alt="Welcome to SmartMomma.com!"
    width="200" height="50" /></td>
    <td width="545" valign="top"><img
    src="../images/channels_top_toolbar.gif" alt="On Sale!" width="535" height="50"
    border="0" usemap="#Map" href="../community/community_main.cfm" /></td>
    </tr>
    <tr>
    <td height="5" colspan="2" valign="top"><img
    src="../images/bottom_navbar.gif" width="750" height="5" /></td>
    </tr>
    </table></td>
    <td width="4">&nbsp;</td>
    <td width="28"></td>
    </tr>
    <tr>
    <td width="68" height="650" valign="top"
    bgcolor="#9900FF"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="9">&nbsp;</td>
    <td width="613" valign="top"><span class="bodycopy"></span>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
    <td width="613" height="45" align="left" valign="middle"
    class="channeltitle">SmartMomma Advantage </td>
    </tr>
    <tr>
    <td height="29" valign="middle" class="bodycopy"><span
    class="articletitle"> Welcome! Update Your Profile </span></td>
    </tr>
    <tr>
    <td height="544" valign="top"><p class="bodycopy">SmartMomma
    Advantage is a FREE program to show you the latest in:</p> <ul>
    <li class="title">Fetal Development Updates</li>
    <li class="title">Infant Development Updates</li>
    <li class="title">Product Promotions &amp; Sales from Your
    Favorite Retailers</li>
    <li class="title">SmartMomma Content Updates </li>
    </ul> <p class="bodycopy">In order to take full
    advantage of our program by personalizing a package just for you, please fill
    out the form below. Information entered in this form is covered by SmartMomma's
    <a href="../privacy_policy.htm" class="link2">Privacy Policy</a>. </p>

    <p class="title">About You</p> <cfform
    action="update_successful.cfm" method="POST" name="advantage2" id="advantage2">
    <table width="613" height="150" border="0" cellpadding="3"
    cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
    <td width="285" height="54" valign="top"><span
    class="bodycopy">
    E-Mail address/Login<span class="style2">*</span>:
    <input name="Email" type="text" class="bodycopy"
    required="yes" value="<cfoutput>#Session.Auth.Email#</cfoutput>"/>
    </span></td>
    <td width="316" valign="top" class="bodycopy"><input
    name="MemID" type="hidden" value="<cfoutput>#Session.Auth.MemID#</cfoutput>"
    />&nbsp;
    </td>
    </tr>
    <tr>
    <td height="44" valign="top"><span class="bodycopy">First
    Name</span><span class="bodycopy">:
    <input name="FirstName" type="text" class="bodycopy"
    value="<cfoutput>#session.auth.FirstName#</cfoutput>" />
    </span></td>
    <td valign="top"><span class="bodycopy">Last Name:
    <input name="LastName" type="text" class="bodycopy"
    value="<cfoutput>#session.auth.LastName#</cfoutput>" />
    </span></td>
    </tr>
    <tr>
    <td height="29" colspan="2" valign="top"><span
    class="bodycopy">
    <input <cfif (#Session.Auth.Precon# EQ
    "yes")>checked</cfif> name="Precon" type="checkbox"
    value="<cfoutput>#session.auth.Precon#</cfoutput>"/>
    I'm currently trying to get pregnant
    </span></td>
    </tr>
    </table>
    <p class="title">Your SmartMomma Advantage <br />
    <span class="bodycopy"><strong>Choose From These Great
    Newsletters!
    </strong></span></p>
    <p class="title">
    <input <cfif (#Session.Auth.SMAlerts# EQ
    "yes")>checked</cfif> name="SMAlerts" type="checkbox"
    value="<cfoutput>#session.auth.SMAlerts#</cfoutput>"/>
    <span class="toolsheadline">SmartMomma Alerts</span><span
    class="bodycopy"> - weekly updates on your favorite stores' SALES &amp;
    DISCOUNTS</span><span class="toolsheadline"><br />
    <input <cfif (#Session.auth.WhatsNew# EQ
    "yes")>checked</cfif> name="WhatsNew" type="checkbox"
    value="<cfoutput>#session.auth.WhatsNew#</cfoutput>" />
    What's New</span><span class="bodycopy"> - updates on what's
    new at SmartMomma</span><span class="toolsheadline"><br />
    <input <cfif (#Session.auth.FetalDev# EQ
    "yes")>checked</cfif> name="FetalDev" type="checkbox"
    value="<cfoutput>#session.auth.FetalDev#</cfoutput>" />
    Fetal Development </span><span class="bodycopy">- update for
    those expecting moms</span><span class="toolsheadline"><br />
    <input <cfif (#Session.auth.InfantDev# EQ
    "yes")>checked</cfif> name="InfantDev" type="checkbox"
    value="<cfoutput>#session.auth.InfantDev#</cfoutput>" />
    Infant Development </span><span class="bodycopy">-
    developmental update on those with babies 12 months and under </span></p>
    <p class="title">
    <input <cfif (#Session.auth.Unsubscribe# EQ
    "yes")>checked</cfif> name="Unsubscribe" type="checkbox"
    value="<cfoutput>#session.auth.Unsubscribe#</cfoutput>" />
    <span class="toolsheadline"> Unsubcribe to
    SmartMomma Advantage</span></p>
    <p class="title"><span class="bodycopy">
    <input name="Operation" type="submit" class="bottom_tags"
    value="Update" action="update_successful.cfm"/>
    Click to go to family information </span></p>
    <p class="bodycopy"> </p>
    </cfform></td>

    PAGE 3: UPDATE SUCCESSFUL

    <!---Include Header--->
    <cfinclude TEMPLATE="SiteHeader.cfm">
    <!---Update Member Table--->
    <!---
    Filename: update_successful.cfm
    Purpose: Update Member Table
    Please Note: End result of update_membership.cfm
    --->
    <!---Set defaults for checkboxes--->
    <cfparam name="form.SMAlerts" default="No">
    <cfparam name="form.WhatsNew" default="No">
    <cfparam name="form.FetalDev" default="No">
    <cfparam name="form.InfantDev" default="No">
    <cfparam name="form.Unsubscribe" default="No">
    <cfparam name="form.Precon" default="No">
    <!---Update--->
    <cftransaction>
    <cfquery name="meminsert" datasource="SM">
    UPDATE tbl_members
    (
    Email,
    FirstName,
    LastName,
    Precon,
    SMAlerts,
    WhatsNew,
    FetalDev,
    InfantDev
    Unsubscribe
    )
    VALUES
    (
    <cfqueryparam value="#FORM.Email#" cfsqltype="cf_sql_varchar">,
    <cfqueryparam value="#FORM.FirstName#" cfsqltype="cf_sql_varchar">,
    <cfqueryparam value="#FORM.LastName#" cfsqltype="cf_sql_varchar">,
    <cfqueryparam value="#FORM.Precon#" cfsqltype="cf_sql_bit">,
    <cfqueryparam value="#FORM.SMAlerts#" cfsqltype="cf_sql_bit">,
    <cfqueryparam value="#FORM.WhatsNew#" cfsqltype="cf_sql_bit">,
    <cfqueryparam value="#FORM.FetalDev#" cfsqltype="cf_sql_bit">,
    <cfqueryparam value="#FORM.InfantDev#" cfsqltype="cf_sql_bit
    Heather939 Guest

  2. Similar Questions and Discussions

    1. Syntax error in UPDATE statement.
      ok i have an update form that i created it is for the admin of the site to add/edit user account info for memebers to login. the form adds or edits...
    2. Syntax error in Where Statement
      Having a problem with what the server says is a syntax error in the Where statement, but cant figure out where it is. <cfif ...
    3. syntax error in replace statement
      What's wrong with this code? strLongDesc = Replace(Replace(Replace(Replace(Trim(Request.Form("LongDesc")),"'","''"),vbC...
    4. Syntax error in UPDATE statement- asp/jscript
      Hi All! I have the following two methods in an asp/jscript page - my problem is that without the update statement there is no error, but with the...
    5. Syntax Error In Update Statement
      I'm having a problem getting one piece of code to work on my app. It's a simple password change. For some reason, I've been getting the following...
  3. #2

    Default Re: Syntax Error Update Statement

    You're missing a comma after the second-to-last <cfparam...>
    Kronin555 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139