Highlighted

I NEED HELP

Community Beginner ,
Sep 17, 2019

Copy link to clipboard

Copied

I need to combine  form and query codes but I couldnt make it.

This is my CFML codes

<cfform name="ADDADA" method="post" >
<table border="3">
<tr>
<td><strong>Musteri ID: </strong></td>
<td><input type="text" name="MHid" >
</td></tr><br>
<tr>
<td><strong>Musteri Hareket Aciklama: </strong></td>
<td><input type="text" name="MHaciklama"> </td></tr>
<br>

<tr>
<td><strong>Musteri Tipi: </strong></td>
<td><input type= "text" name="Mtipi"></td>
</tr>
</table>
<br><input type="submit" name="Kaydet" value="KAYDET">
</cfform>
<cfif IsDefined("form.MHid") and IsDefined("from.MHaciklama")>

<cfquery NAME="ADD" datasource= "DENEME" >

INSERT INTO musterihareketleri (MusteriID,Aciklama,MusteriTipi)
values (
<cfqueryparam cfsqltype="cf_sql_integer" value="#cfform.MHid#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#cfform.MHaciklama#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#cfform.Mtipi#">
)
</cfquery>
</cfif>
<cfquery name="ADD" datasource="DENEME">
select * from musterihareketleri ;

</cfquery>
<cfdump var="#ADD#">

 

Views

293

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

I NEED HELP

Community Beginner ,
Sep 17, 2019

Copy link to clipboard

Copied

I need to combine  form and query codes but I couldnt make it.

This is my CFML codes

<cfform name="ADDADA" method="post" >
<table border="3">
<tr>
<td><strong>Musteri ID: </strong></td>
<td><input type="text" name="MHid" >
</td></tr><br>
<tr>
<td><strong>Musteri Hareket Aciklama: </strong></td>
<td><input type="text" name="MHaciklama"> </td></tr>
<br>

<tr>
<td><strong>Musteri Tipi: </strong></td>
<td><input type= "text" name="Mtipi"></td>
</tr>
</table>
<br><input type="submit" name="Kaydet" value="KAYDET">
</cfform>
<cfif IsDefined("form.MHid") and IsDefined("from.MHaciklama")>

<cfquery NAME="ADD" datasource= "DENEME" >

INSERT INTO musterihareketleri (MusteriID,Aciklama,MusteriTipi)
values (
<cfqueryparam cfsqltype="cf_sql_integer" value="#cfform.MHid#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#cfform.MHaciklama#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#cfform.Mtipi#">
)
</cfquery>
</cfif>
<cfquery name="ADD" datasource="DENEME">
select * from musterihareketleri ;

</cfquery>
<cfdump var="#ADD#">

 

Views

294

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 17, 2019 0
Adobe Community Professional ,
Sep 17, 2019

Copy link to clipboard

Copied

While there are various curious coding practices in your code we might ask about, as for your "problem", could it be just the mistaken "from" for "form" in:

 

IsDefined("from.MHaciklama")>

 

If that's not it, please tell us the exact error or unexpected result you're getting. 

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 17, 2019 0
Community Beginner ,
Sep 17, 2019

Copy link to clipboard

Copied

thats the problem i dont get any error or unexpected reseult

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 17, 2019 0
Adobe Community Professional ,
Sep 17, 2019

Copy link to clipboard

Copied

Did you implement my suggested correction?

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 17, 2019 0
Community Beginner ,
Sep 17, 2019

Copy link to clipboard

Copied

yes i did now i have this error

The error occurred in C:/xampp/htdocs/coldfusion/cfusion/wwwroot/new 2.cfm: line 25
23 : 	INSERT INTO musterihareketleri (ACIKLAMA, MUSTERIID, MUSTERITIPI)
24 : 	values (
25 : 		<cfqueryparam cfsqltype="cf_sql_integer"" value="#cfform.MHid#">,
26 : 		<cfqueryparam cfsqltype="cf_sql_varchar" value="#cfform.MHaciklama#">,
27 : 		<cfqueryparam cfsqltype="cf_sql_varchar" value="#cfform.Mtipi#">

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 17, 2019 0
Adobe Community Professional ,
Sep 17, 2019

Copy link to clipboard

Copied

You will help us to show the actual error, not just where it points to. But I see a mistaken extra double quotes after the first "cf_sql_integer", at least in your last message (though not the first). 

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 17, 2019 0
Community Beginner ,
Sep 17, 2019

Copy link to clipboard

Copied

thanks for your help you are very kind 
i found the error it was about the column names

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 17, 2019 0
Adobe Community Professional ,
Sep 17, 2019

Copy link to clipboard

Copied

Glad you resolved things.

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 17, 2019 0