Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Heather939 #1
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"> </td>
<td width="28"></td>
</tr>
<tr>
<td width="68" height="650" valign="top"
bgcolor="#9900FF"><!--DWLayoutEmptyCell--> </td>
<td width="9"> </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 & 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>"
/>
</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 &
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
-
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... -
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 ... -
syntax error in replace statement
What's wrong with this code? strLongDesc = Replace(Replace(Replace(Replace(Trim(Request.Form("LongDesc")),"'","''"),vbC... -
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... -
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... -
Kronin555 #2
Re: Syntax Error Update Statement
You're missing a comma after the second-to-last <cfparam...>
Kronin555 Guest



Reply With Quote

