Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > ColdFusion

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-11-2006, 09:57 PM   PM User | #1
websiteideas
New to the CF scene

 
Join Date: May 2006
Location: Calpines, California
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
websiteideas is an unknown quantity at this point
Inserting Data from Form into MS Access Database with Coldfusion

Can anyone please tell me what looks wrong with this code? It's only inserting the username and password, but not the other fields.

newuser.cfm:

<form action="insert_user.cfm" method="post">

Login: <input name="UserLogin" type="text"><br>
Password: <input name="UserPassword" type="text"><br>
Email: <input name="EmailName" type="text"><br>
Address: <input name="Address" type="text"><br>
City: <input name="City" type="text"><br>
State: <input name="StateOrProvince" type="text"><br>
Zip Code: <input name="PostalCode" type="text"><br>
Country: <input name="CountryRegion" type="text"><br>
Company: <input name="CompanyName" type="text"><br>
Work Phone: <input name="WorkPhone" type="text"><br>
Work Extension: <input name="WorkExtension" type="text"><br>
Home Phone: <input name="HomePhone" type="text"><br>
Mobile Phone: <input name="MobilePhone" type="text"><br>

<input type="submit">

</form>




insert_user.cfm:

<CFQUERY DATASOURCE="realestate" NAME="insert">

INSERT INTO Contacts(UserLogin, UserPassword, Address, City, StateOrProvince, PostalCode, CompanyName, WorkPhone, WorkExtension, HomePhone, MobilePhone )

VALUES('#form.UserLogin#', '#form.UserPassword#', '#form.Address#', '#form.City#', '#form.StateOrProvince#', '#form.PostalCode#', '#form.CompanyName#', '#form.WorkPhone#', '#form.WorkExtension#', '#form.HomePhone#', '#form.MobilePhone#', '#form.EmailName#')

</CFQUERY>
Edit/Delete Message
websiteideas is offline   Reply With Quote
Old 12-06-2006, 05:26 PM   PM User | #2
tinabme
New to the CF scene

 
Join Date: Jul 2002
Location: Florida
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
tinabme is an unknown quantity at this point
It looks okay, what type of error message are you getting? If no error message do you have access to turn on debugging for your IP? you should be able to look at the debug code to see exactly what is being inserted.
tinabme is offline   Reply With Quote
Old 12-06-2006, 05:33 PM   PM User | #3
tinabme
New to the CF scene

 
Join Date: Jul 2002
Location: Florida
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
tinabme is an unknown quantity at this point
One more thing that comes to mid is the database field size. I don't see any max limitations in your input tags. The address that is being put in may be too big causing it to error out.
tinabme is offline   Reply With Quote
Old 02-18-2007, 10:13 PM   PM User | #4
cfmatt
New Coder

 
Join Date: Feb 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
cfmatt is an unknown quantity at this point
Use cfqueryparam in your sql statement, its good coding practice to do so.
cfmatt is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:38 PM.


Advertisement
Log in to turn off these ads.