<cfquery name="getId" datasource="jckelly2006"> SELECT max(UserNames.UserID) AS maxID FROM UserNames </cfquery> <cfset newID = (#getID.maxID# + 1)> <cfquery name="addUser" datasource="jckelly2006"> INSERT INTO UserNames(UserID, UserName, Password, PrivilegeLevel, fk_ActiveID) VALUES (#newID#, '#form.userName#', '#form.password#', 1, 1) </cfquery> <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Deity Tracker's Registration Page</title> <link rel="stylesheet" href="print.css" type="text/css" media="print" /> <link rel="stylesheet" href="final.css" type="text/css" media="screen" /> </head> <body> <cfinclude template="navLinks.cfm"> <div id="center"> <p class="textLeft"> Welcome to the Deity Tracker Community <strong><cfoutput>#form.UserName#</cfoutput></strong>.<br /> You now have searching privileges.<br /> Please test your <a href="loginForm.cfm">Log-in</a> now. </p> <cfinclude template="contactTemp.cfm"> </div> <div id="right"> <cfinclude template="generalLinks.cfm"> <p class="linkHead"></p> </div> </body> </html>
The error I get is "syntax error in insert into statement" with the Values line highlighted. A link to the actual page to register is http://msit.bloomu.e...addUserForm.cfm which then takes you to http://msit.bloomu.e...dUserAction.cfm after you have entered in both a username and a password and hit register. I have already checked to make sure that the variables with the cfset works.
In case you want the code for the form page, here it is:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Deity Tracker's Registration Page</title>
<link rel="stylesheet" href="print.css" type="text/css" media="print" />
<link rel="stylesheet" href="final.css" type="text/css" media="screen" />
</head>
<body>
<cfinclude template="navLinks.cfm">
<div id="center">
<div class="textCenter">
<cfif isdefined("url.message")>
<h2>Sorry, you were logged out for your own protection.</h2>
</cfif>
<form method="post" action="addUserAction.cfm" name="register">
<p>Please enter your user name:
<input type="text" name="userName">
</p>
<p>Please enter your password:
<input type="password" name="password">
</p>
<p><input name="submit" type="submit" value="Register" />
</p>
</form>
</div>
<cfinclude template="contactTemp.cfm">
</div>
<div id="right">
<cfinclude template="generalLinks.cfm">
<p class="linkHead"></p>
</div>
</body>
</html>
Thanks for any help.

New Topic/Question
Reply



MultiQuote





|