"Data source "name" could not be found"
The database is set up in MySql with no errors. I have added it in ColdFusion under "Data Sources" with no errors, status is OK.
In Dreamweaver I created the form. I viewed the database and table under the database tab. Then under "Server behaviors" I created a "insert record".
Form fields were linked up to the correct lines in the database table.
Below are the 2 secetions of code from that page.
<cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "CONTACT">
<cfquery datasource="redhead">
INSERT INTO contact (name, email, company, findus, questions)
VALUES (<cfif IsDefined("FORM.name") AND #FORM.name# NEQ "">
<cfqueryparam value="#FORM.name#" cfsqltype="cf_sql_clob" maxlength="45">
<cfelse>
''
</cfif>
, <cfif IsDefined("FORM.email") AND #FORM.email# NEQ "">
<cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="45">
<cfelse>
''
</cfif>
, <cfif IsDefined("FORM.company") AND #FORM.company# NEQ "">
<cfqueryparam value="#FORM.company#" cfsqltype="cf_sql_clob" maxlength="45">
<cfelse>
''
</cfif>
, <cfif IsDefined("FORM.findus") AND #FORM.findus# NEQ "">
<cfqueryparam value="#FORM.findus#" cfsqltype="cf_sql_clob" maxlength="100">
<cfelse>
''
</cfif>
, <cfif IsDefined("FORM.questions") AND #FORM.questions# NEQ "">
<cfqueryparam value="#FORM.questions#" cfsqltype="cf_sql_clob" maxlength="1000">
<cfelse>
''
</cfif>
)
</cfquery>
<cflocation url="contact_results.cfm">
</cfif>
Here is the next section of code
<td><form action="<cfoutput>#CurrentPage#</cfoutput>" method="post" name="CONTACT"> <table width="298" border="0" cellpadding="5"> <tr> <td width="77" align="right"><strong>Your name:</strong></td> <td width="195"><label> <input type="text" name="name" id="name"> </label></td> </tr> <tr> <td align="right"><strong>E-mail Address:</strong></td> <td><label> <input type="text" name="email" id="email"> </label></td> </tr> <tr> <td align="right"><strong>Company:</strong></td> <td><label> <input type="text" name="company" id="company"> </label></td> </tr> <tr> <td align="right"><strong>How did you find us?</strong></td> <td><label> <input type="text" name="findus" id="findus"> </label></td> </tr> <tr> <td align="right"><strong>Questions:</strong></td> <td> </td> </tr> <tr> <td colspan="2" align="center"><label> <textarea name="questions" id="questions" cols="35" rows="5"></textarea> <br> <br> <input type="submit" name="SUBMIT" id="SUBMIT" value="Submit"> </label></td> </tr>
Thanks so much for any help in advance - Redhead

New Topic/Question
Reply




MultiQuote




|