473,327 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

How do you pass variables in ColdFusion to MySQL?

Hi All,
I am trying to figure out coldfusion. I previously used php mysql website development, but my friend decided to use the coldfusion setup and now is needing help. Now I keep getting the error "Error: Element Undefined in Form".

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="auto" datasource="mysqlcf_auto" dbname="auto" username="auto" password="pswd1">
  2.  
  3.   INSERT INTO Customer
  4.   (FName,MName,LName,Phone,Cell,Email,Location) 
  5.   VALUES
  6.   ('#form.PURFirstName#', '#PURMiddleName#', '#PURLastName#', '#PURPhoneNumber#', '#PURCellNumber#', '#PUREmail#', '#PURContactLocation#')
  7. </cfquery>
  8.  
Any help is appreciated!
Feb 28 '11 #1
2 2600
Put a
Expand|Select|Wrap|Line Numbers
  1. <cfdump vars="#form#"></cfabort>
at the top of your page

This will dump out any variable that are in available in the form scope.

You have the right idea in your query using the variables.

I would also strongly suggest you use cfqueryparam tag to protect from SQL injection attacks
Here is the link to the online docs
http://livedocs.adobe.com/coldfusion/8/Tags_p-q_18.html

Hope that helps
Feb 28 '11 #2
Check the elements PURFirstName,PURMiddleName,PURLastName,PURPhoneNum ber,PURCellNumber,PUREmail and PURContactLocation whether they exist in form or has a different spelling. The query is not getting the written element from the form.
May 5 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: James E Koehler | last post by:
Hello, I need a little help. I am new to MySQL and am trying to acquire skills in MySQL without the benefit of any formal training although I have been in IT for more years than I care to...
0
by: Keith Wall | last post by:
Is there any way to pass mysql user variables on the command line? I'd like to do this to enable me to parameterised a mysql script. I'd like to be able to use a command line such as: mysql...
2
by: blurz | last post by:
Hi, would like to know whether I can use ViewState to pass variables from one web page to another. I've been trying do this but all I managed to do is to pass the variable to the target page but...
6
by: Raqueeb Hassan | last post by:
Hello There! Have you guys tried inserting variables in mySQL tables? Do I have to use 'quote' as we had been doing to insert strings? mysql> INSERT INTO occurrence (word_id,page_id) VALUES...
0
by: Sam | last post by:
I'm wondering if I can pass variables to "TestForm.aspx" with the way I'm using it. It's acting as a jpeg image and looks like: <%@ Page ContentType="image/Jpeg" %> <%@ Import...
4
by: ruca | last post by:
Hi, How can I pass the values of some variables from page1.aspx to page2.aspx? I try to define some variables in page2 and then when I click a button in page1 it will fill that variables (in...
7
by: Gladen Blackshield | last post by:
Hello All! Still very new to PHP and I was wondering about the easiest and simplest way to go about doing something for a project I am working on. I would simply like advice on what I'm asking...
3
by: pedjasmek | last post by:
I have one link in the second script that leads to the first one.How can I pass variables from the second script to the first one? I cannot use $_GET $_POST variables because I don't use those...
3
by: Joshepmichel | last post by:
Please to help me to following problem I want to do this 1. create Table Name MEMBER on the Database Name "mytestdb", 2. Add the Values to the Table through the Key board Inputs during running...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.